]> Pileus Git - ~andy/fetchmail/commitdiff
Another Shetye fix.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 18 Oct 2002 15:30:43 +0000 (15:30 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 18 Oct 2002 15:30:43 +0000 (15:30 -0000)
svn path=/trunk/; revision=3749

transact.c

index 82729aa6b9fa6cbb1954fdd4bbb4305e94f08019..dbf55f53d540f0d932bd27ee1e6468096c4e83a9 100644 (file)
@@ -371,6 +371,7 @@ int readheaders(int sock,
     flag               no_local_matches = FALSE;
     flag               headers_ok, has_nuls;
     int                        olderrs, good_addresses, bad_addresses;
+    int                        retain_mail = 0;
 
     sizeticker = 0;
     has_nuls = headers_ok = FALSE;
@@ -559,9 +560,8 @@ int readheaders(int sock,
 #endif /* POP2_ENABLE */
            if (num == 1 && !strncasecmp(line, "X-IMAP:", 7)) {
                free(line);
-               free(msgblk.headers);
-               msgblk.headers = NULL;
-               return(PS_RETAINED);
+               retain_mail = 1;
+               continue;
            }
 
        /*
@@ -799,6 +799,13 @@ int readheaders(int sock,
     }
 
  process_headers:    
+
+    if (retain_mail)
+    {
+       free(msgblk.headers);
+       msgblk.headers = NULL;
+       return(PS_RETAINED);
+    }
     /*
      * When mail delivered to a multidrop mailbox on the server is
      * addressed to multiple people on the client machine, there will