0

On a Ubuntu server, what's the easiest way to run a script (e.g. Python) when an email is received?

Email filters would be good, but not necessary.

summatix
  • 225
  • 1
  • 3
  • 6
  • 1
    Have a look at this http://stackoverflow.com/questions/557906/want-procmail-to-run-a-custom-python-script-everytime-a-new-mail-shows-up – user9517 Sep 16 '11 at 07:51

2 Answers2

0

Via procmail. (note this doc starts by suggesting using the .forward mechanism to invoke procmail from the MDA - its a lot simpler to use procmail AS the MDA)

symcbean
  • 21,009
  • 1
  • 31
  • 52
0

If you're already running Sendmail you can add an alias to "|/bin/whatever/you/want/to/run".