Skip Menu |

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

Report information
The Basics
Id: 6789
Status: resolved
Priority: 0/
Queue: MIME-tools

People
Owner: Nobody in particular
Requestors: scoobysnacks [...] joecullin.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: MIME::Parser::Filer evil_filename suggestions
First of all, this module is great. Thanks for taking the time to write and maintain it. I've been using it for years without any modifications, and just this week I've made two that I thought would be useful for most people so I wanted to share them. 1. I got an attachment yesterday with this header: Content-Type: text/html; charset="us-ascii"; name=" " Content-Transfer-Encoding: quoted-printable The all-whitespace (but non-empty) name attribute generated a write-open error. I added a check for this in evil_filename to solve the problem. I also added a default filename for this case in exorcise_filename, but that's not language independent so I don't think you'd want to include it. 2. I often get attachments that are the saved "view source" output of internet explorer, which for some reason defaults to a name like "index[1].html". exorcise_filename changes this to ".html". I changed it to turn [ and ] into underscores, which gives a much more useful filename.
Looks like the all-whitespace filename was addressed long ago. As for exorcise_filename(), it's probably best for users of MIME::Parser to do this as a subclass of MIME::Parser::Filer that exorcises things as appropriate for your use.