Subject: | parsing of spaces in Content-Type header line |
* $Email::MIME::VERSION = 1.82
* This is perl, v5.8.4 built for i386-linux-thread-multi
* Linux localhost 2.6.11 #8 SMP Sun Mar 20 21:09:51 CET 2005 i686 GNU/Linux
Given a header line where the attribute name and values have spaces near the equal sign:
Content-Type: multipart/mixed; boundary = "abc123"
then Email::MIME produces the following in _parse_attributes():
$attribs = {'boundary ' => ' abc123'}
This in turn leads to that this snippet claims the message has only 1 part, but there are more really.
my $msg = Email::MIME->new($raw);
my @parts = $msg->parts;
print scalar @parts; # says 1, should be 2 or whatever
Patch line 42 in ContentType.pm, thus:
s/^([^$tspecials]+?)\s*=\s*// or do { carp "Illegal Content-Type parameter $_";
That parses now correctly:
$attribs = {'boundary' => 'abc123'}