aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--imap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/imap.c b/imap.c
index 94e4da30..c6e3cc8b 100644
--- a/imap.c
+++ b/imap.c
@@ -1061,7 +1061,7 @@ static int imap_fetch_body(int sock, struct query *ctl, int number, int *lenp)
if ((ok = gen_recv(sock, buf, sizeof(buf))))
return(ok);
} while
- (sscanf(buf+2, "%d FETCH", &num) != 1);
+ (!strstr(buf+4, "FETCH") || sscanf(buf+2, "%d", &num) != 1);
if (num != number)
return(PS_ERROR);