Mangled MIME Headers in plain text mail

Mark Sapiro mark at msapiro.net
Tue Apr 21 17:05:54 IST 2009


On Tue, Apr 21, 2009 at 09:39:26AM +0100, Drew Marshall wrote:
> 
> Sorry Kai took a while to get another one in. It's fairly  
> intermittent. So here it is
> 
> http://pastebin.com/m28c03d06
> 
> I am sure I could find more examples.


The message at the above link is defective. It appears that MailScanner
is in fact doing the wrong thing. Jules will have to look at it and
confirm, but here's what I see.

It appears that the original message had MIME structure

multipart/related
    multipart/alternative
        text/plain (the plain text alternative)
        text/html  (the rich text alternative)
    image/jpeg (an image referenced by the HTML part)

Then the MailScanner signature is added as follows:

multipart/related
    multipart/alternative
        text/plain (the MailScanner signature)
        text/plain (the plain text alternative)
        text/html  (the rich text alternative)
    image/jpeg (an image referenced by the HTML part)

This is clearly wrong. There are a couple of ways the signature could be
added. One would be to insert it in the already multipart message.

multipart/related
    text/plain  ((the MailScanner signature)
    multipart/alternative
        text/plain (the plain text alternative)
        text/html  (the rich text alternative)
    image/jpeg (an image referenced by the HTML part)

Another would be to recast the message as multipart mixed with the first
part being the signature and the second part being the original message.

multipart/mixed
    text/plain   (the MailScanner signature)
    multipart/related
        multipart/alternative
            text/plain (the plain text alternative)
            text/html  (the rich text alternative)
        image/jpeg (an image referenced by the HTML part)

In any case, inserting the signature as another alternative within the
multipart/alternative part is clearly wrong.

-- 
Mark Sapiro mark at msapiro net       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan


More information about the MailScanner mailing list