On Wed, 11 Jan 2006, Erik Kangas wrote:
New messages: compare current vs saved "uidnext" can be examined to see if there have been new messages.
Also check uidvalidity to make sure that it has not changed. If it has changed, discard your cache.
Deleted messages: I am not sure how to detect this short of getting a list of all uids and comparing with my local list and removing missing ones.
The fact that UIDs are strictly ascending (unlike POP where UIDs are random) and the provision of consecutive sequence numbers creates some interesting mathematical relationships that can ease the burden. Often you can avoid having to reload the entire UID map by observing that there are no missing UIDs within a particular range.
Hence my oft-repeated statement that a good IMAP client uses *both* UIDs and sequence numbers.
Messages with changed flags: I am not sure how to do this without fetching the flags for all messages and updating my local cache.
Yes, but only when first synchronizing the cache. Once you have done so, you don't need to do so again in the session since the server is required to announce flag changes.
Are there better ways of doing these things with imap/cclient -- the overall goal is to ease the server workload as much as possible through caching. If we have to re-scan headers every time, then caching locally is not much better than just grabbing the headers directly each time.
I don't know much about the Perl module that calls c-client, and your question is a bit vague for me to answer specifically. You are best off looking at existing successful programs that call c-client (e.g., Pine) and see how they work, and then ask questions once on specific points.
-- Mark -- http://staff.washington.edu/mrc Science does not emerge from voting, party politics, or public debate. Si vis pacem, para bellum. _______________________________________________ Imap-uw mailing list [email protected] https://mailman1.u.washington.edu/mailman/listinfo/imap-uw
