fetchmail-friends
[Top] [All Lists]

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

2003-09-16 19:06:41
On Tue, Sep 16, 2003 at  5:01:53PM -0700, Philip Tait wrote:
If we're still talking about the same problem that I posted the patch for:

I suddenly started seeing this happen with messages forwarded from my 
Intel work account some time in August (not spam). My assumption is that 
these invalid header lines result from a configuration change to Intel's 
MS Exchange servers.
...
I'd appreciate it if someone who understands that section of code better 
than I, could come up with a more solid solution.

I've been trying to follow this thread, trying to understand all the
references to "header tags," wondering what a "header tag" could
possibly be. As I understand RFC 822 headers, they start at the
beginning of a line with a word, (possibly a series of words strung
together with '-' or '_') and that word ends with a colon followed by
a space, except the first line which starts with "From ", without the
colon. Header lines may be continued by having the continuation parts
indented with whitespace.  The various RFCs define several headers,
and also allow for "X-" headers that are guaranteed to be benign.  I
believe case is ignored in headers, but they are usually first-
letter-capitalized, like "Received: ".  The first blank line
terminates the header and starts the body. 

But I don't recall mention of "tags" in the RFCs; did I miss something?

If I were writing a sanitizer for malformed headers, I'd prepend
"X-bogus-header: " to any line that didn't begin with either
whitespace or a word less than N chars long ending in a colon
followed by a space, and assume that would bring things into
conformance with RFC 822 at least. There might be some strange
"headers" left there, if the leading word happened to end in a colon,
but I'd be surprised if they'd actually break anything. 

Is this random-text-with-no-colon-starting-lines-within-the-header
what people are referring to as "bogus header tags" in this thread?
Or have I completely misunderstood the problem?

Philip, as I understand your patch, it fixes the problem of a (header?)
line starting with a NULL character.  If I'm not mistaken, NULL has
no legal place in RFC 822 email at all, not in the header or the body.
This sounds like a different problem from the one I talk about above,
and maybe I'm way off base here, but as far as email with NULLs in
it, I'd simply delete the NULLs wherever they're found, and figure
nothing of value was lost.

Cheers,

Jim