fetchmail-friends
[Top] [All Lists]

Re: [fetchmail] Patch for "incorrect header line found while scanning headers"

2003-10-10 06:44:33
Philip Tait <pjtait(_at_)iee(_dot_)org>:
Fetchmail suddenly started rejecting emails forwarded from my work 
account. I tried upgrading to 6.2.4, and the situation got worse - not 
only did fetchmail refuse to download the messages, it deleted them!

A Google search indicates this is a recurring problem, so, in the 
absence of an official fix, here is my quick hack to transact.c (6.2.4) 
that fixes the problem for me:

--- transact.c.orig     2003-09-08 17:21:11.000000000 -0700
+++ transact.c  2003-09-08 16:00:56.000000000 -0700
@@ -492,7 +492,13 @@
                line = rline;
                memcpy(line + linelen - n, buf, n + 1);
            }
-
+           if ((line[0] == 0) && (linelen > 0))
+           {
+               if (outlevel > O_SILENT)
+                   report(stdout, GT_("fixed null line\n"));
+               line[0] = ' ';
+               printf("fixed null line\n");
+           }
            /* check for end of headers */
            if (end_of_header(line))
            {


I hope this helps someone.

There's a cleaner fix.  I've added code to smash out all NULs right
after the socket read.
-- 
                <a href="http://www.catb.org/~esr/";>Eric S. Raymond</a>

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [fetchmail] Patch for "incorrect header line found while scanning headers", Eric S. Raymond <=