Jira stops processing incoming mail with MessageRemovedException errors in logs

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

Mail-based issue creation and/or adding comments to existing issues is failing. This may be occurring intermittently or entirely and may not correspond with any changes to the email server or IMAP/POP inbound email settings within JIRA.

The following errors appear in the catalina.out and/or atlassian-jira-incoming-mail.log:

IMAP Errors

MessageRemovedException

1 2 3 4 5 6 2014-12-17 12:02:42,663 atlassian-scheduler-quartz1.clustered_Worker-4 ERROR ServiceRunner SysOps Reply [atlassian.mail.incoming.mailfetcherservice] SysOps Reply[10121]: Exception: null javax.mail.MessageRemovedException at com.sun.mail.imap.IMAPMessage.forceCheckExpunged(IMAPMessage.java:224) at com.sun.mail.imap.IMAPMessage.loadEnvelope(IMAPMessage.java:1258) at com.sun.mail.imap.IMAPMessage.getSubject(IMAPMessage.java:335) at com.atlassian.jira.plugins.mail.handlers.CreateOrCommentHandler.handleMessage(CreateOrCommentHandler.java:52)

Connection Timeout

1 2 3 4 javax.mail.MessagingException: * BYE JavaMail Exception: java.net.SocketTimeoutException: Read timed out; nested exception is: com.sun.mail.iap.ConnectionException: * BYE JavaMail Exception: java.net.SocketTimeoutException: Read timed out at com.sun.mail.imap.IMAPFolder.open(IMAPFolder.java:961)

POP Errors

MessageRemovedException

1 2 3 java.io.IOException: javax.mail.MessageRemovedException: can't retrieve message #1 in POP3Message.writeTo at com.atlassian.mail.server.impl.SMTPMailServerImpl.sendWithMessageId(SMTPMailServerImpl.java:201) at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:149)

Connection Timeout

1 2 3 javax.mail.AuthenticationFailedException: Read timed out at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:208) at javax.mail.Service.connect(Service.java:295)

Cause

Contention is occurring while JIRA's mail handler is processing emails. This may happen because of:

  1. Multiple instances of JIRA processing incoming email from the same email inbox. This is most commonly seen when establishing a staging server environment for JIRA and similar circumstances.

  2. Multiple mail handlers have been configured to pull email from the same email inbox/folder.

Resolution

Cause 1

Disable inbound email processing for all but one instance of JIRA connected to the same email inbox:

Remove account through JIRA administration...

From Configuring JIRA to Receive Email from a POP or IMAP Mail Server:

  1. Log in as a user with the JIRA Administrators global permission

  2. Navigate to Administration >> System >> Mail >> Incoming Mail (from the left sidebar)

  3. Click Delete to remove unwanted POP / IMAP servers and/or Mail Handlers

or

Disable notifications through start-up scripts...

From Disabling email sending/receiving, un-comment the DISABLE_NOTIFICATIONS=" -Datlassian.mail.senddisabled=true -Datlassian.mail.fetchdisabled=true -Datlassian.mail.popdisabled=true" line from your /bin/setenv.bat file (/bin/setenv.sh if you are not using Windows) and then running startup.

Cause 2

Configure JIRA's mail handlers to process email from separate email inboxes or folders, as described in Creating Issues and Comments from Email to prevent contention.

ℹ️ Creating filters within your email inbox to automatically split inbound email to different folders may be helpful here. See Using Filters - Gmail for more information on this process within Gmail, as example.

Updated on April 16, 2025

Still need help?

The Atlassian Community is here for you.