fetchmail-friends
[Top] [All Lists]

[fetchmail] [PATCH] Re: mail without header delimiter

2003-01-16 23:09:16
Quoting from Benjamin Drieu's mail on Thu, Jan 16, 2003 at 06:28:53PM +0100:
here is a bug report from a Debian user about fetchmail.  He has a
broken Notes server which behaves badly on empty messages.  He issued
a patch to correct this behavior.  He was able to reproduce this
reliably with 6.2.0 as well.

I updated his patch to 6.2.0.  It seems that although it might be
cleaned a bit, it doesn't break things.

Please try this patch instead (tested).

============================================================
diff -Naur fetchmail-6.2.0.orig/transact.c fetchmail-6.2.0/transact.c
--- fetchmail-6.2.0.orig/transact.c     Wed Jan  8 14:44:42 2003
+++ fetchmail-6.2.0/transact.c  Fri Jan 17 10:52:28 2003
@@ -867,18 +867,6 @@
     }
 
     /*
-     * We want to detect this early in case there are so few headers that the
-     * dispatch logic barfs.
-     */
-    if (!headers_ok)
-    {
-       if (outlevel > O_SILENT)
-           report(stdout,
-                  GT_("message delimiter found while scanning headers\n"));
-       return(PS_TRUNCATED);
-    }
-
-    /*
      * Hack time.  If the first line of the message was blank, with no headers
      * (this happens occasionally due to bad gatewaying software) cons up
      * a set of fake headers.  
@@ -1257,7 +1245,15 @@
     *cp++ = '\0';
     stuffline(ctl, buf);
 
-    return(headers_ok ? PS_SUCCESS : PS_TRUNCATED);
+    if (!headers_ok)
+    {
+       if (outlevel > O_SILENT)
+           report(stdout,
+                  GT_("message delimiter found while scanning headers\n"));
+       return(PS_TRUNCATED);
+    }
+
+    return(PS_SUCCESS);
 }
 
 int readbody(int sock, struct query *ctl, flag forward, int len)
============================================================

-- 
Sunil Shetye.

<Prev in Thread] Current Thread [Next in Thread>