Nicholas
Nicholas

Reputation: 2058

CFMAIL error: This operation is not allowed on a closed folder

We have a script that checks a Gmail inbox for new messages, processes any it finds based on the subject and sender, marks said messages read, and then after processing moves the messages to a folder called "ProcessedMessages". This script has been running for several years without incident.

We recently migrated to Azure, and this script began failing on the last command:

 <cfimap action="movemail" 
                connection="myConnection"
                MessageNumber="#x#"
                newfolder="ProcessedMessages">

This line started generating this error every night:

 The cause of this exception was: java.lang.IllegalStateException: This operation is not allowed on a closed folder.

I'm not sure what a closed folder is, but we have tried:

No changes were made to this Gmail account since the switchover to Azure; in fact no one had even logged into it for at least a month before. The username and password are set correctly on the new Azure server, as evidenced by the fact the script can log in and read message and mark them read.

What does this error message mean and what could cause it?

Upvotes: 0

Views: 1859

Answers (1)

Dani Szwarc
Dani Szwarc

Reputation: 1

This is what I found (same issue):

"A common cause of this kind of issues is that the folder is being modified concurrently using the same account and credentials thus leaving the operations in an inconsistent state." from here:

https://help.mulesoft.com/s/article/Intermittent-IMAP-S-error-This-operation-is-not-allowed-on-a-closed-folder

In my case, it's running every 15 seconds, on 3 different email folders, so it would make sense.

I hope this clarifies the reasons for the issue.

Upvotes: 0

Related Questions