Unable to configure Outgoing E-Mail Notifications due to error: 501 5.5.4 Invalid domain name

Still need help?

The Atlassian Community is here for you.

Ask the community


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:

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)

Last modified on Feb 5, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.