]> granicus.if.org Git - mutt/commitdiff
Catch the case that an IMAP server sends "\n\n" after a mail header.
authorThomas Roessler <roessler@does-not-exist.org>
Sun, 30 Apr 2000 06:58:21 +0000 (06:58 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Sun, 30 Apr 2000 06:58:21 +0000 (06:58 +0000)
Diagnosed by Brendan.

imap/message.c

index d1cff077369a26d6a026616daf2065d38c4bf9b2..082632aa8dcca967aaae5cd85fb8ebda697a7af6 100644 (file)
@@ -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);