Specified SMTP Configuration is Ignored and Application Uses localhost and Port 25

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 Mail Servers page displays correctly user defined SMTP server (different from localhost). The following appears in the atlassian-jira.log:

1 2 3 4 5 6 7 8 9 10 11 com.atlassian.mail.MailException: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25; nested exception is: java.net.ConnectException: Connection refused at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:169) at com.atlassian.jira.web.action.admin.mail.SendTestMail.doExecute(SendTestMail.java:93) ... Caused by: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25; nested exception is: java.net.ConnectException: Connection refused at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1391) ...

Cause

JavaMail library attempts to connect the server specified by user and on failure it defaults to localhost and port 25.

Resolution

Ensure that valid Host Name and protocol parameters are specified in SMTP Mail Server section of Mail Servers page.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.