IMAP客户端同步本地邮件服务器? [英] IMAP Client Sync local messages Server?

查看:509
本文介绍了IMAP客户端同步本地邮件服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建IMAP客户端并使它的本地消息存储与服务器同步的最佳常规技术是什么?

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

我想我正在寻找一种正确的方法来找出自上次检查以来服务器上IMAP文件夹中的更改,然后下载这些更改,以将其持久保存到我的本地数据库中……这包括邮件不再位于文件夹中(已删除或移动),新邮件和已更改的邮件...

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...

我想新消息很容易,我可以抓住一个文件夹的最高UID,然后从该UID开始查找消息.我不太确定要检测被删除,移动或更改的消息(也许消息上的某些标志已更改).

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).

谢谢!

推荐答案

要进行同步,可能需要为每个文件夹中的所有消息提供UID和标志. 您可以将本地缓存的UID与返回的服务器进行比较,以此可以检测新消息并删除(

可能您应该使用某种hastable进行搜索/比较,这将加速所有工作.

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.

这篇关于IMAP客户端同步本地邮件服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆