Filetypes in email attachments.

"Martin v. Löwis" martin at
Thu Aug 25 23:02:06 CEST 2005

justin.vanwinkle at wrote:
> I would like to use the magic file to detect the filetype, if this is
> possible.  I have the attachement stored and (generally) decoded in a
> variable.

There is a Python binding to the libmagic library, see

Meanwhile, this binding is part of the standard file(1) distribution.


More information about the Python-list mailing list