MessageRemovedException in log files during email processing

Problem

An exception similar to the following is found in your atlassian-jira.log (or jemh.log) file:

2019-07-03 02:13:02,660 Caesium-1-3 ERROR anonymous Hcp Mail Handler [c.j.j.emh.service.ProfileGroupRunner] javax.mail.MessageRemovedException at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1506) at com.javahollic.jira.emh.engine.support.EMHMailUtils.getBodyImpl(EMHMailUtils.java:1715) at com.javahollic.jira.emh.engine.support.EMHMailUtils.getBody(EMHMailUtils.java:1693) at com.javahollic.jira.emh.engine.support.EMHMailUtils.getBody(EMHMailUtils.java:1664) at com.javahollic.jira.emh.service.ProcessorRunner.execute(ProcessorRunner.java:222)

Cause

The message was removed from the mail server while JEMH was processing it. This could be for many reasons, including:

  • An individual manually logging into the mail server and reading/removing the message

  • A system (other than this Jira/JEMH) accessing the mail server and reading/removing the message

Solution

Determine the entity that is accessing the mail server and prevent access/removal of the message.

Related articles