MIME boundaries ending with "--"
Matt Garretson <[email protected]> Wed, 25 Feb 2015 13:32:47 -0500
| Newsgroups | gmane.mail.bogofilter.general |
|---|---|
| Organization | New York State Assembly |
| Message-ID | <[email protected]> |
(Note, the following refers to Bogofilter 1.2.3, as I don't use 1.2.4 due to db-related problems.) I've noticed a quirk in how bogofilter processes MIME parts, when the boundary string ends with "--". Bogofilter assumes that any appearance of a boundary ending in "--" is the end of the part. This approach does not take into account cases where the boundary string itself ends in "--". (This probably doesn't happen very often, but AFAICT it is permitted, and I have seen it in the wild.) Here is an example from an actual email I got yesterday (quoted): > Content-Type: multipart/mixed; > boundary="--InfrawareEmailBoundaryDepth1_6b5acefc--" Admittedly, it's ugly to have "--" in the string itself, especially at the beginning and/or end. But I think it's legal. So, when the part starts, we have: > ----InfrawareEmailBoundaryDepth1_6b5acefc-- Bogofilter sees the trailing "--" and interprets this as a final boundary, and removes the trailing "--" which causes it not to match anything when looking through the boundary stack. Thus the MIME part is not recognized, the end result being hundreds of garbage tokens like "zKzRkqfvYb2rPaNo" which pushes the score to .5 I'm not sure yet the best way to fix this, but I see some code in mime.c that appears to control this behavior. _______________________________________________ bogofilter mailing list [email protected] https://www.bogofilter.org/mailman/listinfo/bogofilter