From: Sunil S. <sh...@bo...> - 2006-03-03 12:34:02
|
Quoting from Matthias Andree's mail on Wed, Mar 01, 2006: > Well, OK. We'll take this as a safety measure, but I maintain that the > real solution is to properly cache the mailbox state and update it as > untagged responses come in. Caching is certainly possible. However, matching the fetchmail counter to the imap server counter is probably going to be computationally expensive. Is it worth it? For example, the simple 'number' calculation used three times in imap.c: number -= expunged; will have to be replaced by a loop to find out how many mails less than 'number' have been expunged. Suppose, fetchmail starts polling the mailbox and then another email client deletes mails 3 and 5 just when fetchmail is reading mail 1. Lets say that fetchmail analyses the notification correctly after it has deleted and expunged mail 1: IMAP< * 1 EXPUNGE # deletion of mail 1; expunged = 1 IMAP< * 2 EXPUNGE # deletion of mail 3; expunged = 2 IMAP< * 2 EXPUNGE # deletion of mail 5; expunged = 3 So, expunged is now 3 here. Now, suppose fetchmail tries to download mail 2. The above calculation will not work as 'number' will be -1. The above calculation will of course work correctly for mail 6 onwards. The current simplistic assumption works as all expunged mails are necessarily less than 'number'. > I've merged the patch onto branches/BRANCH_6-3 for the nonce, and will > update the trunk from there after the 6.3.3 release. Thanks. -- Sunil Shetye. |