Sending mails from JIRA fails: Need fully-qualified hostname


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.


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 <>:
 Helo command rejected: need fully-qualified hostname

1 answer

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();

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

58 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you