In the postfix configuration, enable allow_mail_to_commands ( http://www.postfix.org/postconf.5.html ). In a Unix account home directory, create a .forward file which begins with a pipe symbol and names your script: |./my_mail_stub.php
For each message sent to the account, postfix will run your script. Your script can obtain the raw message from stdin.
You'll be pleased to know that the principle for sendmail and qmail configuration is broadly similar and shouldn't require any changes to your script.
Comments
In the postfix configuration, enable allow_mail_to_commands ( http://www.postfix.org/postconf.5.html ). In a Unix account home directory, create a .forward file which begins with a pipe symbol and names your script: |./my_mail_stub.php
For each message sent to the account, postfix will run your script. Your script can obtain the raw message from stdin.
You'll be pleased to know that the principle for sendmail and qmail configuration is broadly similar and shouldn't require any changes to your script.
Thanks a bunch. Just about got it working.