From: Thomas Roessler Date: Sun, 30 Apr 2000 06:58:21 +0000 (+0000) Subject: Catch the case that an IMAP server sends "\n\n" after a mail header. X-Git-Tag: mutt-1-1-13-rel~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a6bc1e46add81f032c678bfd134c78fea5edbdc;p=mutt Catch the case that an IMAP server sends "\n\n" after a mail header. Diagnosed by Brendan. --- diff --git a/imap/message.c b/imap/message.c index d1cff077..082632aa 100644 --- a/imap/message.c +++ b/imap/message.c @@ -56,6 +56,8 @@ int imap_read_headers (CONTEXT *ctx, int msgbegin, int msgend) IMAP_HEADER *h, *h0; const char *want_headers = "DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE IN-REPLY-TO REPLY-TO LINES"; int using_body_peek = 0; + int c; + fetchlast = 0; /* define search string */ @@ -255,6 +257,15 @@ int imap_read_headers (CONTEXT *ctx, int msgbegin, int msgend) h = h->next; /* hdata is freed later */ safe_free ((void **) &h0); + + /* + * skip over additional \n characters - Courier IMAP seems to + * put them here. + */ + + while ((c = fgetc (fp)) == '\n') + ; + ungetc (c, fp); } fclose(fp);