Filetypes in email attachments.

Discussion in 'Python' started by justin.vanwinkle@gmail.com, Aug 25, 2005.

  1. Guest

    Hello everyone,

    I'm writing a simple spam filter as a project, partly to learn python.
    I want to filter by filetype, however, the mime content type I get
    using .get_content_type gives limited and possibly bogus information,
    especially when trying to detect viruses or spam.

    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.

    Justin
     
    , Aug 25, 2005
    #1
    1. Advertising

  2. 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

    http://mx.gw.com/pipermail/file/2003/000055.html

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

    Regards,
    Martin
     
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Aug 25, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    1,119
    Mike Meyer
    Jun 22, 2005
  2. Justin Straube
    Replies:
    2
    Views:
    1,168
  3. royG
    Replies:
    11
    Views:
    506
    Tim Chase
    Mar 11, 2008
  4. codewarrior
    Replies:
    0
    Views:
    535
    codewarrior
    May 4, 2009
  5. Peter Green
    Replies:
    0
    Views:
    645
    Peter Green
    Nov 5, 2009
Loading...

Share This Page