Office 365 mail Inbox folder EXPUNGE failed with IMAP using java mail API
Asked Answered
L

1

11

I am connecting Office 365 mailbox using java mail API with IMAP protocol.

We have continuous stream of messages to mailbox and reading those through java mail API. Once messages are read, those will be moved to other folder or deleted. After successful move/delete of a batch I am doing expunge on INBOX folder.

The above functionality is doing good for around 72 hours and then EXPUNGE command is continuously failing. Following is the exception observed

javax.mail.MessagingException: A447 NO EXPUNGE failed.; nested exception is: com.sun.mail.iap.CommandFailedException: A447 NO EXPUNGE failed. at com.sun.mail.imap.IMAPFolder.expunge(IMAPFolder.java:2190) at com.sun.mail.imap.IMAPFolder.expunge(IMAPFolder.java:2151) at com.eiq.socvueportal.securitymonitoring.incidents.feeder.mail.IncidentsMailboxReader.expungeConnectionInbox(IncidentsMailboxReader.java:423) at com.eiq.socvueportal.securitymonitoring.incidents.feeder.mail.IncidentsMailboxReader.updateCompletedConnection(IncidentsMailboxReader.java:311) at com.eiq.socvueportal.securitymonitoring.incidents.feeder.mail.IncidentsMailboxReader.checkAndUpdateConnectionInstances(IncidentsMailboxReader.java:285) at com.eiq.socvueportal.securitymonitoring.incidents.feeder.mail.IncidentsMailboxReader.getUnreadIncidentMails(IncidentsMailboxReader.java:76) at com.eiq.socvueportal.securitymonitoring.incidents.feeder.worker.IncidentMailsProcessor.findAndProcessUnreadMails(IncidentMailsProcessor.java:200) at com.eiq.socvueportal.securitymonitoring.incidents.feeder.worker.IncidentMailsProcessor.run(IncidentMailsProcessor.java:85) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: com.sun.mail.iap.CommandFailedException: A447 NO EXPUNGE failed. at com.sun.mail.iap.Protocol.handleResult(Protocol.java:399) at com.sun.mail.iap.Protocol.simpleCommand(Protocol.java:425) at com.sun.mail.imap.protocol.IMAPProtocol.expunge(IMAPProtocol.java:1479) at com.sun.mail.imap.IMAPFolder.expunge(IMAPFolder.java:2183) ... 10 more

How can this be avoided? And at what scenarios this can be observed?

Lemmueu answered 4/8, 2017 at 9:40 Comment(4)
@Всеволод Тимченко if you want an answer from Microsoft, then you might consider contacting Microsoft. If you want an answer from someone else, then Bill Shannon is as authoritative and credible as anyone's likely to be.Xray
@Xray It's not that I want an answer from Microsoft, I want any information on actual error. "Server's failing the expunge request" is exactly the error message, no one needs stackoverflow to figure this one out. "Close and reopen the folder" is not more of a solution than "Did you try rebooting it? Did you try rebooting it three times?" What are the top 3 most common causes for this? Is this 100% server-side, or somehow malformed request might be to blame? Anything? "Reopen folder", OMG.Reorientation
@Xray also, I tried contacting Microsoft, and their support ended with "Server's failing the expunge request". As this whole conversation seems to lead nowhere, I'm trying to find anyone able to say anything of substance.Reorientation
The actual error message from the server is "EXPUNGE failed". Its command tag is A447 and the error code is NO. NO means that the command received from the client had no syntax error or similar problems, but processing the command failed for some reason.Xray
V
5

The server is failing the expunge request. Contact Microsoft to find out why the server is failing. As a workaround you can close the folder and reopen it; the expunge will be done when you close the folder.

Verisimilar answered 4/8, 2017 at 16:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.