I haven't used SMTPSampler before, but did you read this? "If selected, then send the body as a plain message, i.e. not multipart/mixed, if possible. If the message body is empty and there is a single file, then send the file contents as the message body." [1] If you let it use the file as message body, I think it's proper for JMeter to delimit the lines by CRLF by MIME spec [2]. By the way, I'm doubtful that JMeter handles the lower level mime message handling by itself. It probably has a library handle it.
Regards, Woonsan [1] http://jmeter.apache.org/usermanual/component_reference.html#SMTP_Sampler [2] https://tools.ietf.org/html/rfc2045#section-2.10 On Wed, Feb 8, 2017 at 11:35 AM, Markus Obermann <[email protected]> wrote: > Hello, > i just put some tracing on MTA and i see what jmeter is sending by doing a > "hexdump -C".In fact all "LN" are sending as "0a 0d" which means CRLN :( > Thus the file has LN and Jmeter send it as CRLN.This makes the file invalid > on my server.btw.Thunderbird is doing the same :( > Br.Markus > > > Markus Obermann <[email protected]> schrieb am 16:29 > Mittwoch, 8.Februar 2017: > > > Hello, > I'm using the latest jmeter release and latest jre on a Linux centos > x64.Using the SMTP Sampler I sent one .txt file which has a size of exactly > 3049 bytes.To be sure that the filesize is really 3049 bytes I have put a > small PRE-beanshell sampler with this > File f = new File(path);long size = f.length();System.out.println("size is: " > + size); > And in fact in the command line i can see the output "3049". > > But:Looking on my server i see that the .txt file is recieved with a size of > 3087 bytes.This means that 38 bytes has been added to the filesize by the > SMTP Sampler of jmeter. > To be fair i have to say that im using Linux and if i open the File with "vi" > i get the Message "10L" which means thatthis file contain "LN" (line feed) > only. > To be even more fair the .txt file contains 39 Lines > Now i think that the 38 extra bytes comes from jmeter because he read the > file and do not count it as "LN" but as "CR LN".As the last line (Line 39) do > _not_ have a "CR" this line is not treated as extra byte.Thus you get 38 > extra bytes where you have 39 lines. > Questions:1. Can any dev. please confirm that jmeter (or the SMTP Sampler) do > read the files in as "CR LN" insted on linux you have "LN"?Means am i right > with my assumption? > 2. How can i force jmeter to read the attachment in as "LN"? so that it sends > the file with correct size? > 3. Feature request:Maybe it's possible to add a "checkbox" to the smtp > sampler how "CR LN" should be treated for attachments. > In advice thanks for your answers.Br.Markus > > > > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
