fetchmail-friends
[Top] [All Lists]

Re: [fetchmail] Re: fetchmail: incorrect header line found while scanningheaders

2003-10-10 07:02:35
Jim Osborn <jimo(_at_)eskimo(_dot_)com>:
Until recently, I used an ancient version of fetchmail that failed
badly in the face of NULLs, leaving the following complaint in the log:

  'Unable to process From lines (envelopes)'

and refusing to process any further mail until the offending NULLs
were removed.  My solution was to call a little script in fetchmail's
preconnect phase that examined the end of fetchmail's log, and if it
found the above error message (from the previous invocation of
fetchmail), it would ssh to my ISP and run a script whose heart
contains:

/usr/ucb/mail -f /var/spool/mail/jimo >/dev/null <<HERE
q
HERE

It turns out that good old Berkeley mail removes NULLs from any
folder you invoke it on, giving you a warning "Ignoring NULLs..."
as it opens up.  So this was a cheap, easy hack.

I wish you had told me about this sooner!  I would have tracked
down the problem before now.

My ISP runs no Microsoft software at all, so its occasional NULL
problems couldn't be blamed on MS Exchange.  I always assumed it
was some sync problem in the network somewhere between the various
mail servers.  Whenever I examined NULL-infected mail, the NULLs
were always at the very beginning of the file, at the start of
the leading "From " line, confirming fetchmail's error message above.
Often there'd be 15K NULLs, and sometimes over 100K!  Talk about
malformed email...  Has anyone seen NULLs elsewhere in an email?

I haven't seen any at all that I know of.
 
It's curious that I haven't been bothered by a NULL since July,
while some of you folks, with newer versions of fetchmail, are having
trouble.  Maybe my ISP coincidentally fixed its network problems.
In any case, as far as patching fetchmail, I'd look for NULLs,
particularly before the start of the header, and eliminate them.

I've added code that strips out 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] Re: fetchmail: incorrect header line found while scanningheaders, Eric S. Raymond <=