Read timed out error when sending outbound mail from JIRA applications
This Knowledge Base article was written specifically for the Atlassian Server platform. Due to the Functional differences in Atlassian Cloud, the contents of this article cannot be applied to Atlassian Cloud applications.
JIRA applications fail to send outbound mail, throwing the below exception in the logs. This occurs even if the system memory has been increased and the SMTP server has been verified as not blocking the JIRA server applications from sending emails.
The following appears in the
2011-04-04 16:43:03,841 http-8080-4 ERROR the.hulk 1002x152x1 1wkhzzq 184.108.40.206,127.0.0.1 /secure/admin/SendBulkMail.jspa [action.admin.mail.SendBulkMail] Error sending e-mail. com.atlassian.mail.MailException: javax.mail.MessagingException: Exception reading response; nested exception is: java.net.SocketTimeoutException: Read timed out at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:169) at com.atlassian.jira.web.action.admin.mail.SendBulkMail.doExecute(SendBulkMail.java:252) at webwork.action.ActionSupport.execute(ActionSupport.java:165)
This is known to be caused by either of the following:
- The network cannot transfer the data to the mail server within the specified time interval in the mail server timeout (this can subsequently cause JIRA to exhibit Duplicated issue creation, comments or notifications behaviors, as in that KB article).
- Exchange servers have Message Throttling - JIRA applications will send outbound mail dependent upon the mail configuration, which is by default every minute. At this point a significant number of queued mails may be sent within a short period of time, causing throttling to engage.
- Inbound rules in the network security group (Network Network Deny) on the application is blocking the incoming mail server acknowledgment message after JIRA initiates the connection to the mail server.
- Increase the timeout value for the mailbox(s) affected as in our Configuring JIRA's SMTP Mail Server to Send Notifications documentation. Increasing the value in increments of 10000 (10 seconds) is suggested until the errors are resolved. We also recommend contacting the network administrator to isolate any causes of network traffic slowness. For example, an Anti-virus application scanning all outbound traffic may contribute to this behavior.
Running JIRA in an AWS or DigitalOcean Droplet
If you are running JIRA applications in an AWS environment, or DigitalOcean Droplet, you may be facing the following error when trying to connect ina SMTPserver:
java.net.SocketTimeoutException: connect timed out DEBUG SMTP: trying to connect to host "email-smtp.us-east-1.amazonaws.com", port 465, isSSL true 220 email-smtp.amazonaws.com ESMTP SimpleEmailService-1062777087 BbfCtWdIGnSiqZ8zpXzm DEBUG SMTP: connected to host "email-smtp.us-east-1.amazonaws.com", port: 465 EHLO 172.16.0.105 421 Timeout waiting for data from client.
In this case, please, contact Amazon or DigitalOcean support and request SMTP access in your environment. These Cloud providers usually have a spam blocker enabled by default, therefore it will block any SMTP connection attempt.
- Remove the rule and the emails should be flushed out of the queue.