Hello, I am using Email::MIME to analyze messages. This works fine, but I found that the mail structure analysis fails (partly) when a mail program adds additional parameters to the content type header field of a multipart message, like so:
Content-Type: multipart/related ;boundary="E12E79A3A5A642B5BDEDBECB78526EFD" ;type="text/html" Here, to my knowledge the type parameter makes no sense, so I would say the composing program was not right to add it. Nevertheless, it was a surprise to see the type parameter causes Email::MIME to analyse the message differently. Without the type parameter, all related subparts are recognized. With the type parameter, all the subparts are ignored. Please see the attached script for a demonstration. It just visualizes the detected message structure in a simple way. Here are the results: - without type parameter in the content type: multipart/mixed ;boundary="172DB807A50B41808B5EAA882A381470" multipart/alternative ;boundary="B9B88CD9AA87425DB7C36965BA5C5717" text/plain; charset="Windows-1252" multipart/related ;boundary="E12E79A3A5A642B5BDEDBECB78526EFD" text/html; charset="Windows-1252" text/plain text/plain - with type parameter in the content type: multipart/mixed ;boundary="172DB807A50B41808B5EAA882A381470" multipart/alternative ;boundary="B9B88CD9AA87425DB7C36965BA5C5717" text/plain; charset="Windows-1252" multipart/related ;boundary="E12E79A3A5A642B5BDEDBECB78526EFD" ; type="text/html" text/plain Is it possible to fix this so that regardless of additional content type parameters (except "boundary") the message structure is recognized completely? Thank you in advance Jochen Stenzel P.S.: The demo script analyzes an included demo message without the type parameter if called without arguments, and a message *with* a type parameter if called with any argument.
email-mime-ct-issue.pl
Description: Binary data