Want procmail to run a custom python script, everytime a new mail shows up

Posted by Maddy on Stack Overflow See other posts from Stack Overflow or by Maddy
Published on 2009-02-17T17:37:23Z Indexed on 2010/04/18 17:43 UTC
Read the original article Hit count: 257

Filed under:
|
|
|

I have a pretty usual requirement with procmail but I am unable to get the results somehow. I have procmailrc file with this content:

:0
* ^To.*@myhost
| /usr/bin/python /work/scripts/privilege_emails_forward.py

Wherein my custom python script(privilege_emails_forward.py) will be scanning through the email currently received and do some operations on the mail content. But I am unable to get the script getting executed at the first shot(let alone scanning through the mail content).

  • Is this a correct way of invoking an external program(python) as soon as new mail arrives?
  • And how does my python program(privilege_emails_forward.py) will receive the mail as input? I mean as sys.argv or stdin????

© Stack Overflow or respective owner

Related posts about python

Related posts about mail