From: Sunil S. <sh...@bo...> - 2006-03-10 14:55:47
|
Quoting from Matthias Andree's mail on Fri, Mar 10, 2006: > I've committed the patch. One thing makes me wonder though: > > fetchmail: IMAP> A0004 NOOP > fetchmail: IMAP< A0004 OK NOOP completed. > fetchmail: IMAP> A0005 NOOP > fetchmail: IMAP< * 1 EXISTS > fetchmail: IMAP< * 1 RECENT > fetchmail: IMAP< A0005 OK NOOP completed. > fetchmail: IMAP> A0006 EXPUNGE > fetchmail: IMAP< A0006 OK Expunge completed. > > Why does fetchmail perform an EXPUNGE after NOOP? > Accident or intent? Looks like an accident. The original intention is to do an EXPUNGE immediately after SELECT. In this case, since no mails were found after SELECT, the EXPUNGE was sent after the NOOP(s). This EXPUNGE after NOOP is pointless and confusing. This patch should remove this. ====================================================================== Index: fetchmail-6.3/imap.c =================================================================== --- fetchmail-6.3/imap.c (revision 4730) +++ fetchmail-6.3/imap.c (working copy) @@ -737,16 +737,6 @@ "%d messages waiting after first poll\n", count), count); - /* no messages? then we may need to idle until we get some */ - while (count == 0 && do_idle) { - ok = imap_idle(sock); - if (ok) - { - report(stderr, GT_("re-poll failed\n")); - return(ok); - } - } - /* * We should have an expunge here to * a) avoid fetching deleted mails during 'fetchall' @@ -765,6 +755,23 @@ "%d messages waiting after expunge\n", count), count); } + + if (count == 0 && do_idle) + { + /* no messages? then we may need to idle until we get some */ + while (count == 0) { + ok = imap_idle(sock); + if (ok) + { + report(stderr, GT_("re-poll failed\n")); + return(ok); + } + } + if (outlevel >= O_DEBUG) + report(stdout, ngettext("%d message waiting after re-poll\n", + "%d messages waiting after re-poll\n", + count), count); + } } *countp = count; ====================================================================== -- Sunil Shetye. |