Skip Menu |

This queue is for tickets about the MIME-tools CPAN distribution.

Report information
The Basics
Id: 25037
Status: rejected
Priority: 0/
Queue: MIME-tools

People
Owner: Nobody in particular
Requestors: jonas [...] frukt.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 5.420
Fixed in: (no value)



Subject: MIME::Words: unexpected case
Using MIMEDefang I suddenly saw this in my mail log: Feb 19 17:51:02 chip mimedefang-multiplexor[25672]: Slave 2 stderr: MIME::Words: unexpected case: (<EF><BF><BD>rsmkallelse07.doc) pos 0 Please alert developer. (The <XX> are hexadecimal representation of 8-bit characters.) So, I'm alerting the developer. The error is at MIME/Words.pm line 234: ---8<--- ### Case 4: bug! die "MIME::Words: unexpected case:\n($encstr) pos $pos\n\t". "Please alert developer.\n"; ---8<--- Since it's a "die", it kills the MIMEDefang slave so the mail with the bad file name is never received nor permanently rejected by us. In order to receive the problematic mail with as little delay as possible I put this did this: ----------8<---------- --- Words.pm Sat Mar 18 00:35:22 2006 +++ /usr/local/lib/perl5/site_perl/5.8.7/MIME/Words.pm Mon Feb 19 18:45:05 2007 @@ -181,6 +181,7 @@ sub decode_mimewords { my $encstr = shift; + my $orgencstr = $encstr; my %params = @_; my @tokens; $@ = ''; ### error-return @@ -231,6 +232,11 @@ } ### Case 4: bug! + + warn "MIME::Words: unexpected case:\n$orgencstr\n($encstr) pos $pos\n\t". + "Please alert developer.\n"; + last; + die "MIME::Words: unexpected case:\n($encstr) pos $pos\n\t". "Please alert developer.\n"; } ----------8<---------- Wich gave me this in the log: Feb 19 19:14:24 chip mimedefang-multiplexor[25672]: Slave 7 stderr: MIME::Words: unexpected case: <EF><BF><BD>rsmkallelse07.doc (<EF><BF><BD>rsmkallelse07.doc) pos 0 Please alert developer. IOW, no more info than I allready had. Unfortunately I don't have the mail as it was before our system handled it, and the mail as stored here does not trigger this problem when I try to send it through the system (though that could be because of errors on my part). I'm attaching it anyway since it might still be useful. My first thought is to wrap calls to decode_mimewords() in evals, but a second thought is that it would be nice to be able to specify a default behaviour for bad data. (Also, there's a little bunch of calls to this function in MIMEDefang...) In a system such as MIMEDefang it might be better to do a warning and return something like the string "[Error!]" that lets the system do it's work on a malformed mail while still making it obvious that something wasn't right. Malformed headers are, unfortunately, something to be expected in mail so software has to be able to handle them without dying... Regards /Jonas
Subject: 1171904007.22016_0.dale
Download 1171904007.22016_0.dale
application/octet-stream 9.9k

Message body not shown because it is not plain text.

From: jonas [...] frukt.org
Crap! I attached the wrong message. Here's the problematic one. /Jonas
Download 1171908725.24120_34.dale
application/octet-stream 409.5k

Message body not shown because it is not plain text.

Not enough info to reproduce.