Piping an email to a script is a rather handy feature. It’s popular with service desk software as well as notification systems. With Postfix, there are 2 ways to go about it - you can either set up filters or set up an ‘pipe alias’. I tend to prefer the latter as it’s quicker to set up, even though it’s not the ‘correct’ way :)
All you need to do is add a new line to /etc/aliases like so:
Don’t forget to run
If you’re using a virtual domain setup, then edit your virtual aliases file and add a line to pipe it to the entry above:
[email protected] emailaddress
Once this is done, simply hash the virtual aliases file and off you go!
PHP - Generate Random Strings
Setup Virtual Domains in Postfix (Without a Database)