如何使用imap文件夹的UIDVALIDITY和HIGHESTMODSEQ同步电子邮件 [英] How to use UIDVALIDITY and HIGHESTMODSEQ of an imap folder to sync email

查看:152
本文介绍了如何使用imap文件夹的UIDVALIDITY和HIGHESTMODSEQ同步电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Java邮件从imap服务器本地同步电子邮件.我阅读了RFC-4551和RFC-4549,但仍不清楚有关同步邮件的算法.基本上我不确定如何结合文件夹的HIGHESTMODSEQ使用UIDVALIDITY来同步来自服务器的电子邮件.如果

I want to sync emails locally from an imap server using java mail. I read RFC-4551 and RFC-4549, but still not clear about the algorithm to sync mails. Basically I am not sure how to use UIDVALIDITY in conjugation with HIGHESTMODSEQ of a folder to sync emails from server. Can someone please clarify the algorithm for syncing mails if

  1. 服务器支持CONDSTORE
  2. 服务器不支持CONDSTORE

推荐答案

此问题的完整答案比适用于stackoverflow的答案要长得多.也许您可以告诉我们您认为是什么算法,并且我们可以帮助您确定算法是否正确?

A complete answer to this question is much longer than is appropriate for stackoverflow. Maybe you can tell us what you think the algorithm is, and we can help you figure out if you got it right?

我可以澄清一下UIDVALIDITY ... UIDVALIDITY会告诉您该文件夹是否与您之前查看的文件夹相同,或者它是一个完全不同的文件夹,而恰好具有相同的名称.如果删除了文件夹,并使用相同的名称创建了一个新文件夹,则UIDVALIDITY将更改.文件夹中邮件的UID均与文件夹的UIDVALIDITY相关.如果文件夹的UIDVALIDITY更改,则丢弃该文件夹的所有缓存数据.

I can clarify UIDVALIDITY... UIDVALIDITY tells you if the folder is the same folder you looked at previously, or if it's a completely different folder that just happens to have the same name. If the folder is deleted and a new folder is created with the same name, the UIDVALIDITY will change. The UIDs of messages in the folder are all relative to the UIDVALIDITY of the folder. If the UIDVALIDITY of a folder changes, throw away all cached data for the folder.

这篇关于如何使用imap文件夹的UIDVALIDITY和HIGHESTMODSEQ同步电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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