You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jakarta.apache.org by bu...@apache.org on 2010/10/05 11:09:41 UTC

DO NOT REPLY [Bug 50046] New: SMTPSampler partially ignores the plain body checkbox

https://issues.apache.org/bugzilla/show_bug.cgi?id=50046

           Summary: SMTPSampler partially ignores the plain body checkbox
           Product: JMeter
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Main
        AssignedTo: notifications@jakarta.apache.org
        ReportedBy: moreira@privasphere.com
                CC: hauser@acm.org


The new functionality added to the SMTP Sampler (send plain body) is partially
ignored.

If there is some text in the message area, this test will be sent as body
independent of the check box being selected or not.

With the checkbox selected I expected JMeter to ignore anything that may be
written there.

Attached you will find a patch that corrects this behavior. Additionally, In
the patch I removed the verification on the attached file and body length.

The number of attached files is later checked on the if statement, and the
length of the message should simply be ignore.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org


DO NOT REPLY [Bug 50046] SMTPSampler partially ignores the plain body checkbox

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50046

--- Comment #3 from Sebb <se...@apache.org> 2010-10-05 19:39:33 EDT ---
My testing generated the following error if there was no body:

java.io.IOException: No content

In order to suppress this, I had to add the following:

message.setText("");

which results in an empty body.

This can be achieved with the current code by ensuring that:
- there are no files
- the message field is empty
- "send plain body" is checked

Does that not do what you want? If not, what is wrong with the output?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org


DO NOT REPLY [Bug 50046] SMTPSampler partially ignores the plain body checkbox

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50046

Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #5 from Sebb <se...@apache.org> 2010-10-07 06:49:54 EDT ---
(In reply to comment #4)
> Thank you very much for the quick reply.
> In regard to comment 3, I also saw that same error in my own tests. I believe
> your solution message.setText(""); is the correct one.
> 
> From what I see in the code, the need for the "plain body" checkbox is
> doubtful. Am I correct that we can achieve the exact same behavior of the check
> box simply by not adding any text to the message area and not add any
> attachment?

No.

The check-box affects the format of the message.

> By selecting the checkbox, I expected JMeter to create a plain body and not use
> the text in the message area. If we use the text in there, then it is not plain
> body anymore.

Yes, it is still plain body - as opposed to multipart/mixed.

> So I believe the correct behaviour should rather be:
> 
> •  If checkbox Send plain body is checked and Attach files is empty 
>     ==> SMTP sampler sends a message with content message.setText("")

It does that if you leave the message field empty.

> •  If checkbox Send plain body is checked and Attach files is not empty
>    ==> SMTP sampler send a message with a "send-as-is" for attach files
> (mailBody is ignored)

It does that, so long as the message field is empty.

> Summarizing, I see no reason to add message text if we select plain body. This
> is what I attempted to do with my patch.

Your patch would mean one could only use multipart/mixed, even if there were no
files.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org


DO NOT REPLY [Bug 50046] SMTPSampler partially ignores the plain body checkbox

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50046

Milamber <mi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #2 from Milamber <mi...@apache.org> 2010-10-05 19:02:03 EDT ---
Hello,
Original patch for Bug 49775 is to "Allow sending messages without a body"
Finally the patch became "Send plain body"

I think you want this behavior below (with your patch 50046 & 50047):
If Message field is empty and checkbox Send plain body  is checked and Attach
files is empty ==> SMTP sampler sends a message without a body?

sebb in Bug 49775, final patch added this behaviors:
* If Message field is empty *or not* and checkbox Send plain body  is checked
and Attach files is empty ==> SMTP sampler sends a message with content Message
field (mailBody)
* If Message field is empty and checkbox Send plain body is checked and Attach
files is not empty
==> SMTP sampler send a message with a "send-as-is" for attach files (mailBody
is ignored)

I think we need a new checkbox "Suppress body (mail sent with no body)" which
disable Message field and all attach files/eml?

Milamber

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org


DO NOT REPLY [Bug 50046] SMTPSampler partially ignores the plain body checkbox

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50046

--- Comment #1 from Luciana Moreira <mo...@privasphere.com> 2010-10-05 05:10:36 EDT ---
Created an attachment (id=26121)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26121)
Patch to correctly handle the plain body checkbox

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org


DO NOT REPLY [Bug 50046] SMTPSampler partially ignores the plain body checkbox

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50046

--- Comment #6 from Luciana Moreira <mo...@privasphere.com> 2010-10-07 07:01:12 EDT ---
> > By selecting the checkbox, I expected JMeter to create a plain body and not
> use
> > the text in the message area. If we use the text in there, then it is not
> plain
> > body anymore.
> 
> Yes, it is still plain body - as opposed to multipart/mixed.

Thx for the clarification, this phrase you posted made things clear to me now.
So, yes, no need for fix.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org


DO NOT REPLY [Bug 50046] SMTPSampler partially ignores the plain body checkbox

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50046

--- Comment #4 from Luciana Moreira <mo...@privasphere.com> 2010-10-06 10:09:12 EDT ---
Thank you very much for the quick reply.
In regard to comment 3, I also saw that same error in my own tests. I believe
your solution message.setText(""); is the correct one.

>From what I see in the code, the need for the "plain body" checkbox is
doubtful. Am I correct that we can achieve the exact same behavior of the check
box simply by not adding any text to the message area and not add any
attachment?

By selecting the checkbox, I expected JMeter to create a plain body and not use
the text in the message area. If we use the text in there, then it is not plain
body anymore.

So I believe the correct behaviour should rather be:

•  If checkbox Send plain body is checked and Attach files is empty 
    ==> SMTP sampler sends a message with content message.setText("")

•  If checkbox Send plain body is checked and Attach files is not empty
   ==> SMTP sampler send a message with a "send-as-is" for attach files
(mailBody is ignored)

Summarizing, I see no reason to add message text if we select plain body. This
is what I attempted to do with my patch.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org