From 91341f7be66f2865fe4000dae05dd78f448b3ca6 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 9 Sep 2002 13:43:55 +0000 Subject: Sunil Shetye's latest fix patch. svn path=/trunk/; revision=3707 --- imap.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'imap.c') diff --git a/imap.c b/imap.c index 40abdb2a..9005fbf9 100644 --- a/imap.c +++ b/imap.c @@ -712,6 +712,9 @@ static int imap_getsizes(int sock, int count, int *sizes) if ((ok = gen_recv(sock, buf, sizeof(buf)))) return(ok); + /* an untagged NO means that a message was not readable */ + else if (strstr(buf, "* NO")) + ; else if (strstr(buf, "OK") || strstr(buf, "NO")) break; else if (sscanf(buf, "* %u FETCH (RFC822.SIZE %u)", &num, &size) == 2) { @@ -784,9 +787,19 @@ static int imap_fetch_headers(int sock, struct query *ctl,int number,int *lenp) break; /* try to recover from chronically fucked-up M$ Exchange servers */ else if (!strncmp(ptr, "NO", 2)) + { + /* wait for a tagged response */ + if (strstr (buf, "* NO")) + imap_ok (sock, 0); return(PS_TRANSIENT); + } else if (!strncmp(ptr, "BAD", 3)) + { + /* wait for a tagged response */ + if (strstr (buf, "* BAD")) + imap_ok (sock, 0); return(PS_TRANSIENT); + } } if (num != number) -- cgit v1.2.3