Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Email listener failing continuously with FolderClosedException



FolderClosedException generated in the log files multiple times.

Error Messages

caught javax.mail.FolderClosedException when processing message number 9
at com.sun.mail.imap.IMAPMessage.getProtocol(
at com.sun.mail.imap.IMAPMessage.loadFlags(
at com.sun.mail.imap.IMAPMessage.isSet(

Steps to Reproduce

Run the email listener.

Root Cause

A defect or configuration issue in the operating environment.


The folder on the email server is closed when it has an issue. The email listener does not expect the folder to be closed and continues processing the email. Despite the occurrence of FolderClosedException, the email listener tries to process the email. Exceptions are logged and the emails are not read until the folder is reopened. On the next run, the folder is reopened and the email is processed.

An enhancement request, FDBK-26911, is created for consideration by Pega Product Management to improve the email listener's behavior in terms of folder management.


Published July 23, 2018 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us