Mangled MIME Headers in plain text mail

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


On Tue, Apr 21, 2009 at 05:44:56PM +0100, Julian Field wrote:
> I've just tested your message against my copy of MailScanner, the latest 
> released version.
> It puts the plain-text signature at the end of the first plain-text bit 
> of text, and it puts the HTML signature at the end of the HTML bit of 
> text, just as I intended.
> 
> It doesn't create any new MIME parts for the signature at all, as I 
> didn't think it would.
> 
> So I don't know where those signatures are coming from, but I sure 
> cannot reproduce this. MailScanner doesn't create new message MIME parts 
> when it adds signatures, feel free to read the code.


Perhaps the defect with the "extra" text/plain alternative was in the
original message.

Jules,

If the original message were

multipart/related
    Multipart/alternative
        text/plain (empty)
        text/plain (plain alternative)
        text/html (html alternative)
    image/jpeg

would Mailscanner add the plain signature to both text/plain parts?


> 
> Jules.
> 
> On 21/4/09 17:05, Mark Sapiro wrote:
> >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.
> >
> >   
> 
> Jules
> 
> -- 
> Julian Field MEng CITP CEng
> www.MailScanner.info
> Buy the MailScanner book at www.MailScanner.info/store
> 
> MailScanner customisation, or any advanced system administration help?
> Contact me at Jules at Jules.FM
> 
> PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
> PGP public key: http://www.jules.fm/julesfm.asc
> 
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> 
> 

-- 
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