aboutsummaryrefslogtreecommitdiffstats
path: root/imap.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2002-09-09 13:43:55 +0000
committerEric S. Raymond <esr@thyrsus.com>2002-09-09 13:43:55 +0000
commit91341f7be66f2865fe4000dae05dd78f448b3ca6 (patch)
tree23ca050519a599578303e560be32a2a2d1ff8638 /imap.c
parentdc688e8c7f7165d0019a56c0079df651d704664b (diff)
downloadfetchmail-91341f7be66f2865fe4000dae05dd78f448b3ca6.tar.gz
fetchmail-91341f7be66f2865fe4000dae05dd78f448b3ca6.tar.bz2
fetchmail-91341f7be66f2865fe4000dae05dd78f448b3ca6.zip
Sunil Shetye's latest fix patch.
svn path=/trunk/; revision=3707
Diffstat (limited to 'imap.c')
-rw-r--r--imap.c13
1 files changed, 13 insertions, 0 deletions
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)