IMAP Client Sync local messages Server?

不想你离开。 提交于 2019-12-11 19:29:26

问题


What's the best general technique for creating an IMAP client and keeping its local message store in sync with the server?

I guess I'm looking for the right way to figure out what's changed in an IMAP folder on the server since the last time I checked, and download those changes, to persist them to my local database... This would include messages no longer in the folder (deleted or moved), new messages, and changed messages...

I guess new messages is easy, I can grab the highest UID i have for a folder and then find messages since that UID. I'm not so sure about detecting messages that were deleted or moved though, or changed (maybe some flags changed on a message).

Thanks!


回答1:


For sync, probably you need each folder all messages UID and flags. You can compare local cached UIDs to server returned, with this you can dedect new messages and deleted(

Probably you should use some kind of hastable for search/compare, this will speed up all.



来源:https://stackoverflow.com/questions/7758925/imap-client-sync-local-messages-server

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