IMAP mail fails with FolderClosedException in logs in Jira server
Symptoms
The following stack trace appears in the atlassian-jira-incoming-mail.log:
2013-07-12 09:52:50,478 ERROR [xxx] QuartzScheduler_Worker-3 ServiceRunner xxxx[xxxxx]: Exception: null
javax.mail.FolderClosedException
at com.sun.mail.imap.IMAPMessage.getProtocol(IMAPMessage.java:145)
at com.sun.mail.imap.IMAPMessage.getHeader(IMAPMessage.java:743)
at com.atlassian.jira.service.services.mail.MailFetcherService$MessageProviderImpl.getAndProcessMail(MailFetcherService.java:257)
at com.atlassian.jira.service.services.mail.MailFetcherService.runImpl(MailFetcherService.java:356)
at com.atlassian.jira.service.services.file.AbstractMessageHandlingService.run(AbstractMessageHandlingService.java:257)
at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:61)
at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:48)
at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
or
2013-07-12 13:24:28,875 INFO [xxxx] QuartzScheduler_Worker-3 ServiceRunner xxxx[xxxxx]: Cannot handle message as the recipient(s) (xxx) do not match the catch email xxx
Cause
The problem can be caused by the following circumstances:
- In mail server having a limit of emails to be sent by each person daily and the quota was being exceeded.
- JIRA is trying to scan/read but has too many emails which takes a considerable amount of time.
- There are limits set by the mail server that only certain amount of mails can be read by JIRA on a particular time
- There is corrupted mail blocking JIRA from continuing to scan/read other emails
- If catch email address is an alias email (such as Gmail).
Please see these bug tickets:
-
JRA-29228Getting issue details...
STATUS
- JSDSERVER-6099Getting issue details... STATUS
Resolution
Identify and remove the mail conditions such as:
- Remove the mails to archive or move them to a different folder/mailbox from the one that JIRA is trying to scan through.
- Increase the timed out value by referring to the resolution in this KB article
- If using Gmail and an alias of an email address, please try to test with the original (non-alias'd) mailbox and see if it works or not.