aboutsummaryrefslogtreecommitdiffstats
path: root/imap.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-10-05 01:49:26 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-10-05 01:49:26 +0000
commite89387bfee912d747b31d3a57d96891e8bedac0a (patch)
treef17913bc5897cac48b7c6f219b7110a832e2bab0 /imap.c
parent313a954360f1659a3a27e1b02c8de7d2aaf99e15 (diff)
downloadfetchmail-e89387bfee912d747b31d3a57d96891e8bedac0a.tar.gz
fetchmail-e89387bfee912d747b31d3a57d96891e8bedac0a.tar.bz2
fetchmail-e89387bfee912d747b31d3a57d96891e8bedac0a.zip
Fix the Kooijman bug.
svn path=/trunk/; revision=1478
Diffstat (limited to 'imap.c')
-rw-r--r--imap.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/imap.c b/imap.c
index bd8af5fa..1d8dbeb1 100644
--- a/imap.c
+++ b/imap.c
@@ -408,8 +408,14 @@ static int imap_getrange(int sock,
if (pass > 1)
{
- ok = gen_transact(sock, "NOOP");
- if (ok != 0)
+ /*
+ * We have to have an expunge here, otherwise the re-poll will
+ * infinite-loop picking up un-expunged message.
+ */
+ ok = 0;
+ if (deletions && ctl->expunge > 1)
+ ok = gen_transact(sock, "EXPUNGE");
+ if (ok || gen_transact(sock, "NOOP"))
{
error(0, 0, "re-poll failed");
return(ok);
@@ -625,7 +631,7 @@ static int imap_delete(int sock, struct query *ctl, int number)
if ((ok = gen_transact(sock, "EXPUNGE")))
return(ok);
- expunged = deletions;;
+ expunged = deletions;
}
return(PS_SUCCESS);
@@ -634,10 +640,8 @@ static int imap_delete(int sock, struct query *ctl, int number)
static int imap_logout(int sock, struct query *ctl)
/* send logout command */
{
-
-
/* if expunges after deletion have been suppressed, ship one now */
- if (ctl->expunge <= 0 && deletions)
+ if (ctl->expunge == 0 && deletions)
{
int ok;