Getting exception java.net.NoRouteToHostException while configuring mail server
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
While configuring the SMTP server, an exception is thrown by your JIRA applications, and the following appears in the atlassian-jira.log
:
1
2
3
4
5
6
7
An error has occurred with sending the test email:
com.atlassian.mail.MailException: javax.mail.MessagingException: Could not connect to SMTP host: server02.example.local, port: 25;
nested exception is:
java.net.NoRouteToHostException: No route to host
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:169)
at com.atlassian.jira.web.action.admin.mail.SendTestMail.doExecute(SendTestMail.java:93)
at webwork.action.ActionSupport.execute(ActionSupport.java:165)
Cause
The JIRA application server is not able to reach the Mail server with the given hostname and port.
Resolution
Please report this problem to the network administrator with regards to this problem. The following points might help troubleshoot the problem better :
From your JIRA application server, can you ping the <hostname>?
Check the output of the command nc -vnz -w 1 <hostname> 25
Is the hostname correctly getting resolved in the DNS? Can you try using the IP instead?
Does the SMTP server require authentication?
Is there a firewall that blocks port 25?
Is the internet/network down?
Is there a proxy setting?
Was this helpful?