diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2006-05-15 16:11:06 +0000 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2006-05-15 16:11:06 +0000 |
commit | bb1a6cc615ab21a113ba7ebe273cadcb30fcb3be (patch) | |
tree | c64a5d75ea55d41bd62472768c83659ecc517ac4 /imap.c | |
parent | c2156b017a3106c09c17f5134d5ef3a9561bf424 (diff) | |
download | fetchmail-bb1a6cc615ab21a113ba7ebe273cadcb30fcb3be.tar.gz fetchmail-bb1a6cc615ab21a113ba7ebe273cadcb30fcb3be.tar.bz2 fetchmail-bb1a6cc615ab21a113ba7ebe273cadcb30fcb3be.zip |
Make IMAP4 IDLE work on servers that do not update RECENT counts. Reported by Lars Tewes.
svn path=/branches/BRANCH_6-3/; revision=4842
Diffstat (limited to 'imap.c')
-rw-r--r-- | imap.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -679,7 +679,7 @@ static int imap_getrange(int sock, int *countp, int *newp, int *bytes) /* get range of messages to be fetched */ { - int ok; + int ok, oldcount; char buf[MSGBUFSIZE+1], *cp; /* find out how many messages are waiting */ @@ -696,7 +696,9 @@ static int imap_getrange(int sock, * * this is a while loop because imap_idle() might return on other * mailbox changes also */ - while (recentcount == 0 && do_idle) { + oldcount = count; + while (count <= oldcount && recentcount == 0 && do_idle) { + oldcount = count; smtp_close(ctl, 1); ok = imap_idle(sock); if (ok) @@ -706,7 +708,7 @@ static int imap_getrange(int sock, } } /* if recentcount is 0, return no mail */ - if (recentcount == 0) + if (recentcount == 0 && count <= oldcount) count = 0; if (outlevel >= O_DEBUG) report(stdout, ngettext("%d message waiting after re-poll\n", |