​ imap在办公室365上产生MesdagingException / MessageAgeMevioException
我尝试通过IMAP和Spring IntegrationFlow获取一些消息。以下代码运行良好(自4年以来),直到邮箱移至Office 365。
return IntegrationFlows
.from(Mail.imapInboundAdapter(imapMailReceiver).get(),
e -> e.autoStartup(true)
.poller(Pollers.cron(properties.getCron(), TimeZone.getTimeZone("Europe/Paris"))
.maxMessagesPerPoll(MAILS_PER_POLL)
.errorHandler(mailReceiverErrorHandler("imapMailReceiver", param, portefeuille))
)
)
.log(LoggingHandler.Level.DEBUG, m -> loggerMessageMail(m, "IMAP"))
.channel(c -> mailChannel)
.get();
现在,我们有时会得到此例外:
Exception: failure occurred while polling for mail; nested exception is javax.mail.MessagingException: IOException while copying message; nested exception is: com.sun.mail.util.MessageRemovedIOException
经过一些研究,当您尝试获取消息时,会发生这种例外。让我们考虑一下,我无法更改Office 365服务器或对其进行一些操作(例如清洁删除的消息...)
是否可以在集成流上过滤这些消息以避免此异常?
I try to get some messages with IMAP and Spring IntegrationFlow. The following code is working well (since 4 years) until the mailbox moved to Office 365.
return IntegrationFlows
.from(Mail.imapInboundAdapter(imapMailReceiver).get(),
e -> e.autoStartup(true)
.poller(Pollers.cron(properties.getCron(), TimeZone.getTimeZone("Europe/Paris"))
.maxMessagesPerPoll(MAILS_PER_POLL)
.errorHandler(mailReceiverErrorHandler("imapMailReceiver", param, portefeuille))
)
)
.log(LoggingHandler.Level.DEBUG, m -> loggerMessageMail(m, "IMAP"))
.channel(c -> mailChannel)
.get();
Now, we sometimes get this exception:
Exception: failure occurred while polling for mail; nested exception is javax.mail.MessagingException: IOException while copying message; nested exception is: com.sun.mail.util.MessageRemovedIOException
After some research, this exception occurs when your try to get an expunged message. Let's consider that I can't change the Office 365 server or do some action on it (like clean expunged messages...)
Is there a way to filter on the IntegrationFlow those messages to avoid this exception ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论