Unable to configure Outgoing E-Mail Notifications due to error: 501 5.5.4 Invalid domain name
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
When configuring e-mail for outgoing notifications, you get an exception: 501 5.5.4 Invalid domain name
and if you enable DEBUG logging for outgoing mail, the following appears in the logs:
1
2
3
4
5
http-bio-8080-exec-17 DEBUG jiraadmin 805x4100x1 3anfad9 10.1.1.1 /secure/admin/VerifySmtpServerConnection!update.jspa [com.atlassian.mail.outgoing] DEBUG SMTP: connected to host "smtp.mycompany.com", port: 25
http-bio-8080-exec-17 DEBUG jiraadmin 805x4100x1 3anfad9 10.1.1.1 /secure/admin/VerifySmtpServerConnection!update.jspa [com.atlassian.mail.outgoing] EHLO jira.mycompany.com.
http-bio-8080-exec-17 DEBUG jiraadmin 805x4100x1 3anfad9 10.1.1.1 /secure/admin/VerifySmtpServerConnection!update.jspa [com.atlassian.mail.outgoing] 501 5.5.4 Invalid domain name
http-bio-8080-exec-17 DEBUG jiraadmin 805x4100x1 3anfad9 10.1.1.1 /secure/admin/VerifySmtpServerConnection!update.jspa [com.atlassian.mail.outgoing] HELO jira.mycompany.com.
http-bio-8080-exec-17 DEBUG jiraadmin 805x4100x1 3anfad9 10.1.1.1 /secure/admin/VerifySmtpServerConnection!update.jspa [com.atlassian.mail.outgoing] 501 5.5.4 Invalid domain name
Cause
The first thing that happens after a TCP connection to the SMTP port at the remote mail server has been established is that the client sends the message "EHLO [hostname]" to establish the SMTP connection and state its own hostname. This name has to be a Fully Qualified Domain Name (FQDN) and if it does not follow that format Microsoft Exchange will throw an "Invalid domain name" error and reject the connection. (Other mail servers might have similar issues.)
Example
In the log example above, the name "jira.mycompany.com." after "EHLO" has a trailing dot (.) which is not allowed in this SMTP handshake context. This caused Microsoft Exchange to reject the connection.
Resolution
The SMTP client in Jira fetches the name to use from the hostname defined in the operating system and it needs to be corrected there to be a correctly formatted FQDN. On Linux this name is often found in the
/etc/hostname
file (but can be in another location, depending on the distribution)
Was this helpful?