[patch] tag Received lines and parse headers better.

David Relson relson at osagesoftware.com
Sun Jul 20 02:15:26 CEST 2003


Michael,

Thanks for the sample.  I've been busy with the single wordlist code (which 
is almost ready for release as 0.14.0), but have time now to take a look, 
learn, and (with luck) fix :-)

David

At 07:10 PM 7/19/03, michael at optusnet.com.au wrote:
>David Relson <relson at osagesoftware.com> writes:
> >
> > lexer_v3.l has macro WHITESPACE as "[ \t\n]". Is there any reason not
> > to just use that?
>
>Yes, because you don't want to match "\n\n" which "\n{WHITESPACE}" would 
>do. :)
>
> > Michael, there's some C code for unfolding header lines.  Could the
> > problem be in that, rather than lexer_v3.l???
>
>Want to point out that code? I doubt the problem is there.
>
>The crux of my problem is that '\n' normally calls got_newline() which
>resets the tag. So in the case of
>To: Fred
>         Smith <fred at smith.com>
>
>Only the 'Fred' gets tagged with 'to:Fred'. My terribly simple
>solution was to have the lexer eat '\n\t' without calling got_newline()
>so that the tag doesn't get reset.
>
>(Actually, I think I should be doing 'lineno += 1;' there
>as well).
>
>Michael.





More information about the Bogofilter mailing list