|Subject:||Header parsing fails with misleading error message with unusual $\ values (particularly newline)|
|X-Mailer:||MIME-tools 5.427 (Entity 5.427)|
When $\ has a nonstandard value, MIME::Parser::process_header ends up writing out stray $\s to the internal $headstr scalar (I couldn't quite track down where this was happening, but read_chunk seems plausible). As a result, the resulting header can't be parsed. This is particularly confusing with $\ set to \n (probably the most common non-null value), because the leading newline is interpreted as a zero-length header, which MIME::Parser interprets as an error in parsing (because not the whole header was parsed), giving an error message saying that the erroneous line is the line before the first line. Fixing this is likely a simple matter of a "local $\" somewhere near the start of process_header, and would probably be faster than documenting the restriction. Information common in bug reports that is almost certainly irrelevant in this case: $ perl -v This is perl, v5.10.1 (*) built for i486-linux-gnu-thread-multi $ uname -a Linux desert 2.6.32-34-generic #77-Ubuntu SMP Tue Sep 13 19:40:53 UTC 2011 i686 GNU/Linux To reproduce, set $\ to \n, then try to parse any message with at least one header line.