From: Sunil S. <sh...@bo...> - 2010-01-28 09:52:05
|
Hi Matthias, I am thinking of making some improvements to imap search in fetchmail. Please check which of these improvements are acceptable for fetchmail 6.3 series. ============================================================================================ 1. In r3838, the "SEARCH UNSEEN" was changed to "SEARCH UNSEEN NOT DELETED". Some imap servers do not support such a complex search phrase. I could find only one reference for that: http://lists.ccil.org/pipermail/fetchmail-friends/2004-June/008897.html I propose that that change should be undone. Note that "SEARCH UNSEEN NOT DELETED" gives different result from "SEARCH UNSEEN" only when - another e-mail client has marked some mails for deletion without seeing, - that e-mail client has not expunged the deleted mails, and - fetchmail is keeping mails (so that fetchmail also has not expunged the deleted mails). The comment in the code reads: /* don't count deleted messages, in case user enabled keep last time */ This comment is incorrect. This is because fetchmail always marks the mail as \Seen irrespective of whether fetchmail deletes it or keeps it. So, that mail will not show up in the next "SEARCH UNSEEN". ============================================================================================ 2. Some servers do not support "SEARCH" at all. Here are some references for that: http://lists.ccil.org/pipermail/fetchmail-friends/2004-May/008675.html http://lists.ccil.org/pipermail/fetchmail-friends/2005-January/009351.html In this case, as a fallback, fetchmail should use something like: FETCH 1:1000 FLAGS and process all mails without \Seen as unseen. ============================================================================================ 3. The reply to "SEARCH UNSEEN" overflows fetchmail buffer when there are more than 1860 unseen mails. fetchmail should do a range search: SEARCH 1:1000 UNSEEN SEARCH 1001:2000 UNSEEN ... ============================================================================================ -- Sunil Shetye. |