Error - SocketException: Network is unreachable: connect - when setting Outgoing SMTP Mail Server in JIRA
Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.
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
Summary
Symptoms
After you finish setting up the Outgoing SMTP Mail Server in JIRA, while you try to test the connection the the following error appears:

The following stack traces appears in the atlassian-jira.log
:
1
2013-07-25 15:00:36,343 http-bio-8080-exec-16 ERROR test 900x1185x1 11bp8rq 192.168.0.105 /secure/admin/VerifySmtpServerConnection!update.jspa [plugins.mail.webwork.VerifyMailServer] Unable to connect to the server at test.mail.smtp due to the following exception: java.net.BindException: Cannot assign requested address: connect
Diagnosis
Try to verify whether the host name of the SMTP mail server is correct or not.
Check on the credential for the SMTP mail server make sure the username and password is correct
Use netcat (sudo apt-get install netcat) to test the connection to the SMTP mail server and determine if it can be established (nc -vnz -w 1 <mail_server_ip> <port>).
Cause
SMTP host name is invalid or there is some restriction that block JIRA to connect to the SMTP host name. On Windows 7 this exception is known to be thrown due to problems with Java trying to use the IPv6 address.
Solution
Resolution
Most probably there is anti-virus and firewall installed in the JIRA host machine that is blocking the host name of the SMTP mail server. Try to double check on the inbound and outbound rules on both anti-virus and firewall and set exception for the SMTP host name.
Windows 7 Only:
Stop JIRA.
Add the following argument to the JVM as per Setting Properties and Options on Startup:
1
-Djava.net.preferIPv4Stack=true
Start JIRA.
Was this helpful?