script to read emails and extract attachments from cron

Discussion in 'Python' started by JohnRHarlow@gmail.com, Feb 6, 2006.

  1. Guest

    Hi:

    I am looking for advice on the best way to set up a process to read
    incoming emails (from a normal unix mailbox on the same host)
    containing a gzipped telemetry attachment. I'd like the script to
    extract the attachment into a directory where another process will pick
    it up. I plan to run it every minute out of cron, so it would probably
    start by moving the mbox file to another name so that incoming emails
    and later instances of itself won't be affected.

    I'm new to Python (I've mostly tweaked other scripts until now) and
    just looking for advice on how to put such a program together. I'm
    particularly interested in how to deal with encoded binary attachments.

    Thanks
    John
     
    , Feb 6, 2006
    #1
    1. Advertising

  2. Dan M Guest

    On Mon, 06 Feb 2006 10:57:23 -0800, wrote:

    > Hi:
    >
    > I am looking for advice on the best way to set up a process to read
    > incoming emails (from a normal unix mailbox on the same host)
    > containing a gzipped telemetry attachment. I'd like the script to
    > extract the attachment into a directory where another process will pick
    > it up. I plan to run it every minute out of cron, so it would probably
    > start by moving the mbox file to another name so that incoming emails
    > and later instances of itself won't be affected.


    You might want to take a look at
    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/86675 and
    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/86676

    I'm using those two recipes for a project very similar to what you
    described.

    Dan
     
    Dan M, Feb 6, 2006
    #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. Jules Mitland

    Saving attachments from emails

    Jules Mitland, Oct 22, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    492
    bruce barker
    Oct 22, 2004
  2. Diego F.

    Attachments in emails

    Diego F., May 16, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    420
    Diego F.
    May 16, 2005
  3. Replies:
    4
    Views:
    427
  4. codewarrior
    Replies:
    0
    Views:
    539
    codewarrior
    May 4, 2009
  5. Peter Green
    Replies:
    0
    Views:
    648
    Peter Green
    Nov 5, 2009
Loading...

Share This Page