CC: | dfs+pause [...] roaringpenguin.com |
Subject: | Double ; parsing bug in ParseParams |
I was debugging an issue with our anti-spam setup, and ran into the following "bug" in
Mime::Tools.
It seems there is an increasing number of mailers out there (eg the mailinglist software of the
popular Typo3 CMS) that send "strange" multipart headers.
They send something like this:
Show quoted text
> X-Mailer: TYPO3 Direct Mail module
> X-Priority: 3
> Mime-Version: 1.0
> Content-Type: multipart/alternative;;
> boundary="----------part_1_499d36ca96aea"
(Notice the double ; between multipart/alternative and the boundary).
I couldn't find any specific reference in the RFCs about double-;'s but it seems MIME::Tools
fails to parse it correctly. To test this, I wrote a small script:
Show quoted text> #!/usr/bin/perl
> #
> use MIME::Head;
>
> my $head = MIME::Head->new->from_file("testmail");
>
> print "mimetype: " . $head->mime_type;
> print "\n";
> print "boundary: " . $head->multipart_boundary;
> print "\n";
Expected output would be:
Show quoted text> mimetype: multipart/alternative
> boundary: ----------part_1_499d36ca96aea
while actual output is:
Show quoted text> mimetype: multipart/alternative
> boundary:
This has been tested with v5.8.8 and MIME::Tools verions 5.420 and 5.427 (installed from
CPAN).