pipe email to php script postfix

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!
tdilbertAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bernard S.CTOCommented:
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
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bernard S.CTOCommented:
Hi,

Where do U currently stand on this? How did U solve it?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.