Sending mails from JIRA fails: Need fully-qualified hostname

Marcin Hewelt December 16, 2014

Hello,

I am using a SMTP server in our university that requires mail clients to include the fully-qualified hostname in HELO reqeusts. Apparently, JIRA sends only a short hostname. Can I configure JIRA to use a fully-qualified hostname?

Running "hostname -f" on the JIRA server gives me the full hostname by the way.

Thanks,
Marcin

An error has occurred with sending the test email:
com.atlassian.mail.MailException: javax.mail.SendFailedException: Invalid Addresses;
  nested exception is:
    com.sun.mail.smtp.SMTPAddressFailedException: 504 5.5.2 <141.89.225.5>:
 Helo command rejected: need fully-qualified hostname

1 answer

0 votes
Piotr Klimkowski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 16, 2014

In some configurations java might not be able to get the FQDN, you can try running this code to see what it returns.

InetAddress localHost = InetAddress.getLocalHost();
System.out.println(localHost.getCanonicalHostName());

JIRA uses javamail to send email. I didn't check this but it should be possible to use this property to set the name with a system property upon JIRA startup.

mail.smtp.localhostStringLocal host name. Defaults to InetAddress.getLocalHost().getHostName(). Should not normally need to be set if your JDK and your name service are configured properly.

Suggest an answer

Log in or Sign up to answer