pipe email to php script postfix

tdilbert used Ask the Experts™
First of all please allow me to say that I am very new to linux and ubuntu and postfix.

I am trying to create a mail server that will accept all mail from a bunch of fictitious email addresses but instead of postfix delivering these to a mailbox, I want the emails to be redirected to a PHP script. From there I will handle the emails in PHP and take care of the contents. I do not want anything stored in postfix mailboxes.

So far I've been able to fire up a ubuntu box, install postfix and get postfix to not throw errors when i telnet on port 25 from my windows machine and try to send it mail using the following tutorial.

The problem I have is that the email is not being redirected to the php script and I can't figure out how to change that.

I've been following just about every tutorial there is out on the web but all of them have gaps in their instructions as they assume you are already an advanced linux or postfix user. The best one I've found so far is here but I cannot su www-data as I'm getting the following error;

This account is currently not available.

Open in new window

Also when emails get "delivered" to postfix, I am getting the following error;

Aug  1 10:49:46 BMPOSTFIX01 pipe[2082]: fatal: pipe_command: execvp /path/to/file/postfix1.php: Permission denied

Open in new window

Please help!
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
www-data is the default user name in Apache for the web-server page-delivery service (I think for nginx webserver too, but did not check)

Test running ./postfix.php with any user you want... but it should finally be the user which will run the script. Access rights issues might arise at the script level (should be runnable by "user" but usually not "group" nor "others") and at the logfile level (should be writable by the user running the script, whether as "user" or "group", readabl by user and group) etc

Where do U currently stand on this? How did U solve it?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial