Sending Email Fails Due to 501 Syntax: HELO Hostname Error

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

The following error is logged in Confluence or JIRA logs:

1 2 An error has occurred with sending the test email: com.atlassian.mail.MailException: javax.mail.MessagingException: 501 Syntax: HELO hostname

Some variations of the same error:

1 Unable to connect to the server at exchange.company.com due to the following exception: javax.mail.MessagingException: 501 Syntax: HELO hostname

Cause

Server's hostname is not defined, so Confluence or JIRA sends the server's IP address instead of the hostname on the HELO SMTP command.

Resolution

Edit /etc/hosts file (or C:\Windows\system32\drivers\etc\hosts) adding an entry to convert your computer's IP to its hostname. It will be something like:

1 192.168.132.27 exchange.company.com

This can be fixed as well on the DNS server. Indeed, make sure JIRA is using the correct DNS server.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.