Bug 61285 - SMTP Sampler doesn't configure localhost name
Summary: SMTP Sampler doesn't configure localhost name
Status: NEW
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 3.2
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
Depends on:
Reported: 2017-07-13 01:33 UTC by michal.rames
Modified: 2017-07-16 13:45 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description michal.rames 2017-07-13 01:33:35 UTC
If a jmeter is run on a computer not connected to a domain, the underlying JavaMail implementation resolves the computer name for EHLO command. 

According to the https://tools.ietf.org/html/rfc5321 only fully qualified domain name may be used. Computer name usually isn't a fully qualified domain name.

As a result the SMTP server may respond with '501 Invalid EHLO'

This can be easily overriden in src/protocol/mail/org.apache.jmeter.protocol.smtp.sampler.protocol.SendMailCommand.java in public void prepareMessage():

props.setProperty("mail.smtp.localhost", localhostDomainName);

And set from GUI via SmtpSampler ... 

If you accept this as a bug fix or enhancement request, I am offering to provide the required code. Let me know what's the best way (e.g. pull request in GitHub? )

Thanks / Michal
Comment 1 Felix Schumacher 2017-07-13 18:31:57 UTC
Thanks for the report. I would be happy if you would prepare a patch.

I think it would be useful to broaden the scope a bit and let the user specify any key value pair she likes for the properties in props.
Comment 2 Philippe Mouawad 2017-07-16 13:45:30 UTC
Thanks for proposal, to contribute Github is a better way, see:

- http://jmeter.apache.org/building.html