Re: [PATCH] Boundary String Error

From: Bjarni R. Einarsson (
Date: Fös 15 Des 2000 - 21:04:41 UTC

On 2000-12-15, 14:25:52 (-0600), Michael Kellen wrote:
> Anomy (1.33<=) breaks many MIME multipart messages by incorrectly
> trying to DecodeHeader() on the boundary string. This leads to
> a rewritten boundary string which does not match the one used in
> the body of the message. mutt deals just fine, Netscape/Mozilla
> refuse to display it without View->source and it disappears in
> Outlook never to be seen again. In specific, we have seen the
> case of MIME boundaries with text in parentheses in them being
> incorrectly interpreted as RFC822 comments. Eudora creates such
> messages.

Interesting, thanks for the patch and the bug report.

Could you also send me an unsanitized example of a message which
triggers this behavior?

This seems to be one of many problems that can be caused by Anomy's
incomplete RFC822 support, which I hope to address one of these days.

I'm not convinced that your patch is the right one though - stripping
RFC822 comments and decoding that header is IIRC the Right Thing To
Do, according to the MIME RFCs. I think the correct patch would be
to *properly* handle RFC822 (which is actually quite hard), and am a
bit wary of applying your patch, since I'm afraid it will cause the
dual problem (MIME boundaries with embedded RFC822 comments getting

I'm also somewhat surprised at your claim that this misunderstanding
on the Sanitizer's part is causing messages to get corrupted - Anomy
generally doesn't alter the MIME headers unless there is a problem
with them, and the "bug" you describe should (for "clean" mail) only
lead to the message contents not getting properly sanitized.

There are other cases (to do with invalid MIME input) which can lead
to boundary strings getting broken - I'm corrently working on fixing
them and would be very interested to see if the problems you are
having are related to them or not.

So please send me a sample to play with! And please gzip it and
attach it to a message, so intermediate mailers don't damage it...

Bjarni R. Einarsson                           PGP: 02764305, B7A3AB89                -><-    

Check out my open-source email sanitizer:

-- This mailing list's home page is: There you can find subscription instructions and possibly an archive. is a free Icelandic mailing list service.

hosted by