On Tue, Aug 16, 2011 at 06:47:42AM -0400, Kevin A. McGrail wrote: > > >Apart from trusting the filename extension? Examining the first > >few bytes of the attachment for non-ASCII characters (excluding > >UTF encoding markers) is the only thing that springs to mind. > > > >File::Type perhaps? Or is that overkill? > > > File::Type wouldn't be overkill if Content Type is missing.
What function in SA needs to know it correctly? I think it's safe to assume such as text (what do MUAs do?). We have the binary problem regardless. I guess some rules could be useful to detect faked content type etc, but I've yet to see a good "magic" module in CPAN.. I'd prefer SA had efficient internal code to detect few chosen types that might be useful (if any).
