[patch] tag Received lines and parse headers better.

michael at optusnet.com.au michael at optusnet.com.au
Sun Jul 20 01:10:00 CEST 2003


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