apache / apache/jmeter

SMTP Sampler doesn't configure localhost name

Open
#4,431 2 comments 0 reactions 0 assignees View on GitHub
os: All P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

**michal.rames** ([Bug 61285](https://bz.apache.org/bugzilla//show_bug.cgi?id=61285&redirect=false)):
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

Severity: normal
OS: All

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.