Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
Have a look at this… – Iain Sep 16 '11 at 7:51

2 Answers 2

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)

share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.