Subject: | Improve MIME type detection |
I noticed that when AUTO is specified as the Type of a message, only the
string in $params{Path} is passed to MIME::Types from build(...). This
prevents AUTO typing for messages (or more likely, attachments) built
with either Data or FD instead of Path.
Here is a simple patch that allows a fallback to $params{Filename},
which is easily passed in addition to FD or Data to build(...).
-----------------------------------------------
961c961
< elsif ($type eq 'AUTO') { $type = $self-
Show quoted text
>suggest_type($params{Path}); }
---
Show quoted text> elsif ($type eq 'AUTO') { $type = $self-
>suggest_type($params{Path} || $params{Filename}); }