postfix execute external command on every new email

edit /etc/postfix/master.cf


smtp inet n - - - - smtpd -o content_filter=my_scripts:
my_scripts unix - n n - - pipe
flags=Xhq user=username argv=/usr/bin/php /my_scripts.php

X – perform final delivery
h – set the domain & recipient to lowercase
q – quote white space & other special characters


more info

incoming mail and php

setup postfix to forward incoming email to php

Advertisements

Published by

paragasu

Different. In a good way

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s