From 5d8baab700b5ea100ccc93495071605e094bd84e Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Tue, 14 Mar 2006 12:27:24 +0000 Subject: Do not send EXPUNGE after NOOP-idling (Sunil Shetye's patch, fetchmail-users@). svn path=/branches/BRANCH_6-3/; revision=4739 --- imap.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'imap.c') diff --git a/imap.c b/imap.c index a877a590..42f57281 100644 --- a/imap.c +++ b/imap.c @@ -736,16 +736,6 @@ static int imap_getrange(int sock, "%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' @@ -764,6 +754,23 @@ static int imap_getrange(int sock, "%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; -- cgit v1.2.3