attachments and binary data

David Relson relson at osagesoftware.com
Tue Nov 30 03:30:04 CET 2004


On Tue, 30 Nov 2004 03:10:00 +0100
Matthias Andree wrote:

...[snip]...


> Does the boundary match? If so, why doesn't bogofilter skip over this
> quickly, forward to the next boundary, in the mime code?

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;

Adding:

     case MIME_APPLICATION:  BEGIN SKIP; break;

and 

   <SKIP>.   ; /* ignore */
   <SKIP>^$  { BEGIN TEXT };

might be interesting (or something like it).



More information about the bogofilter-dev mailing list