Listening to folder create, delete, renamed and mail flagged events in imap server?

旧巷老猫 提交于 2019-12-23 03:17:33

问题


Using IMAP IDLE it is possible to listen for new mail and delete mail events. I used node-imap module in node.js to do that. But is it possible to listen for the flag change events like mark as read, unread and also folder creation/deletion/rename events?

I read about IMAP NOTIFY extension here they specified imap client but it seems gmail is not supporting it and also in node.js I can't find anymodules that implemented this "IMAP NOTIFY". Please give any suggestion to achieve this.


回答1:


As for the flag and keyword changes, yes, the IDLE extension was designed just for this purpose. Please note that gmail does not report flag changes when in IDLE. The linked thread contains a workaround. GMail's behaivor is completely breaindead, of course.

As for other changes, the NOTIFY extension is what you are looking for, but its support among servers is rather scarce -- only Dovecot, AFAIK. If your favorite IMAP client library doesn't offer it already, you should ask their authors.



来源:https://stackoverflow.com/questions/21981316/listening-to-folder-create-delete-renamed-and-mail-flagged-events-in-imap-serv

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!