Subject: | Double-decoding failure in 5.500, caused by a 'fix' #63739 |
Date: | Wed, 26 Jan 2011 19:02:47 +0100 |
To: | bug-MIME-tools [...] rt.cpan.org |
From: | Mark Martinec <Mark.Martinec [...] ijs.si> |
A change RT #63739 between MIME-tools-5.428 and MIME-tools-5.500
is now causing mail parsing to flop fatally with a die() in MIME::Words.
The problem occurs because the MIME decoding of Content-Type.name
(and similar fields) now occurs twice: once in MIME/Field/ParamVal.pm
converting the file name to Perl characters (Unicode), then again in
MIME::Words::decode_mimewords called from MIME::WordDecoder::decode,
which dies on seeing a non-byte character.
To reproduce:
$ perl -MMIME::Parser -e 'MIME::Parser->new->parse(\*STDIN)' <0.txt
MIME::Words: unexpected case:
(βCURE.txt) pos 0
Please alert developer.
A sample message 0.txt:
From: test@example.com
Subject: test
Date: Tue, 25 Jan 2011 14:35:04 +0100
Message-Id: <123@example.com>
Content-Type: text/plain; name*=utf-8''%CE%B2CURE%2Etxt
test
Mark