Postfix – Run Script on Incoming Email Message

postfixUbuntu

All,

I need to run a script everytime there is an incoming email message to a postfix email server. I have read the docs but I was wondering what would be the best approach to do this. Would anybody give me some hint or examples on how to do this. The postfix server is running under Ubuntu.

Thanks heaps for your help

Best Answer

You could use the After-Queue Content Filter feature: http://www.postfix.org/FILTER_README.html

The readme file contains an example of a very simple filter shell script. You could start with that example and build your own script.

Related Topic