Jira notification emails fail to be sent due to read timed out error

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server 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

Problem

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 applications from sending emails.

The following appears in the atlassian-jira.log:

2011-04-04 16:43:03,841 http-8080-4 ERROR the.hulk 1002x152x1 1wkhzzq 11.22.33.xx,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)

Note that other errors might also be thrown in the Jira logs:

  • Example 1

    2016-03-11 09:56:47,557 WARN [] Sending mailitem com.atlassian.support.tools.salext.mail.SupportRequestMailQueueItem@6c57ea6 username 123x4567x8 abcde1 1.2.3.4 /secure/admin/MailQueueAdmin.jspa An error has occurred whilst closing the connection to the outgoing mail server: AA ServiceDesk Out. This could be caused by a time-out on closing this connection, increase the timeout in smtp server configuration. Alternatively, set the 'mail.smtp.quitwait' (or 'mail.smtps.quitwait' for ssl) system property to false.
    javax.mail.MessagingException: Can't send command to SMTP host;
          nested exception is:
            java.net.SocketException: Software caused connection abort: socket write error
        at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:2163) [mail-1.4.5.jar:1.4.5]
        at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:2150) [mail-1.4.5.jar:1.4.5]
        at com.sun.mail.smtp.SMTPTransport.close(SMTPTransport.java:1220) [mail-1.4.5.jar:1.4.5]
        at com.atlassian.mail.server.impl.SMTPMailServerImpl.sendWithMessageId(SMTPMailServerImpl.java:183) [atlassian-mail-2.5.6.jar:?]
        at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:150) [atlassian-mail-2.5.6.jar:?]
        at com.atlassian.support.tools.salext.mail.AbstractSupportMailQueueItem.send(AbstractSupportMailQueueItem.java:61) [plugin.2238643682187341319.stp-3.7.22_1457584780532.jar:3.7.22]
        at com.atlassian.support.tools.salext.mail.SupportRequestMailQueueItem.send(SupportRequestMailQueueItem.java:56) [plugin.2238643682187341319.stp-3.7.22_1457584780532.jar:3.7.22]
    ...
  • Example 2

    2016-03-11 09:56:47,557 ERROR [] Sending mailitem com.atlassian.support.tools.salext.mail.SupportRequestMailQueueItem@6c57ea6 username 123x4567x8 abcde1 1.2.3.4 /secure/admin/MailQueueAdmin.jspa Error occurred in sending e-mail: com.atlassian.support.tools.salext.mail.SupportRequestMailQueueItem@6c57ea6
    com.atlassian.mail.MailException: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM
    
    at com.atlassian.mail.server.impl.SMTPMailServerImpl.sendWithMessageId(SMTPMailServerImpl.java:213) [atlassian-mail-2.5.6.jar:?]
    at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:150) [atlassian-mail-2.5.6.jar:?]
    at com.atlassian.support.tools.salext.mail.AbstractSupportMailQueueItem.send(AbstractSupportMailQueueItem.java:61) [?:?]
    at com.atlassian.support.tools.salext.mail.SupportRequestMailQueueItem.send(SupportRequestMailQueueItem.java:56) [?:?]
    at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:66) [atlassian-mail-2.5.6.jar:?]
    at com.atlassian.jira.mail.JiraMailQueue$1.apply(JiraMailQueue.java:51) [JiraMailQueue$1.class:?]
    at com.atlassian.jira.mail.JiraMailQueue$1.apply(JiraMailQueue.java:48) [JiraMailQueue$1.class:?]
    at com.atlassian.jira.util.velocity.DefaultVelocityRequestContextFactory.runWithStaticBaseUrl(DefaultVelocityRequestContextFactory.java:110) [DefaultVelocityRequestContextFactory.class:?]
    at com.atlassian.jira.util.DefaultBaseUrl.runWithStaticBaseUrl(DefaultBaseUrl.java:50) [DefaultBaseUrl.class:?]
    ...
    

Environment

Jira Server/Data Center on any version from 8.0.0.

Cause

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 the bug JRASERVER-67825 - Getting issue details... STATUS )
  • 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. 

Resolution

  • Increase the timeout value for the mailbox(s) affected as in our Configuring an 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 12.34.65.78
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. 


DescriptionJIRA 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.
ProductJira
PlatformServer
Last modified on Sep 12, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.