attachments and binary data

Matthias Andree matthias.andree at gmx.de
Tue Nov 30 03:45:54 CET 2004


David Relson <relson at osagesoftware.com> writes:

> Matthias,
>
> Looking at the code, I see get_token() calling the flex parser to get
> tokens and then discarding what's found (if the mime type indicates
> that's what should be done).  Grepping the code for MIME_APPLICATION
> doesn't reveal code to skip parsing attachments.  I've not examined the
> code too deeply, hence might have missed something relevant.
>
> Looking in lexer_v3.l there's an interesting bit of code:
>
>   type = get_content_type();
>   ...
>   switch (type) { 
>      case MIME_TEXT_HTML: BEGIN HTML; break;
>      case MIME_MESSAGE:   yy_set_state_initial(); break;
>      default:             BEGIN TEXT;

I have the vague feeling that MIME parsing _must not_ be part of the
lexer, but it's too long that we cared for that code. The flexer's input
routine (YYINPUT or however it's spelled) shouldn't see non-text
attachments (except for the attachment headers).

-- 
Matthias Andree



More information about the bogofilter-dev mailing list