Getting exception java.net.NoRouteToHostException while configuring mail server
Symptoms
While configuring the SMTP server, an exception is thrown by your JIRA applications, and the following appears in the atlassian-jira.log
:
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?