Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create mail server using postfix and i want to create simple scrip using php to filter incoming email. so the diagram is like this : incoming email-->postfix-->php filter-->postfix-->destination address. The questions are: 1. How to set up postfix so it will send incoming email to my php script? 2. How to configure php to send back incoming email to postfix after filtering? Mail server is build in ubuntu 11.04.

Thank you

share|improve this question
There is a PHP milter SAPI. (I know nothing about it.)

share|improve this answer
Howto: create PHP script to filter incoming email on POSTFIX MAIL SERVER

1)you need to create bash script that send the file to the php.
2)the bash script sends the email using "sendmail" command

share|improve this answer
Welcome to Server Fault! One sure fire way to bring yourself to the attention of the system is to post the same answer to multiple questions. As you appear to be the owner of the target blog I think you should read our faq in particular May I promote products or websites I am affiliated with here?. – Iain Feb 21 '13 at 8:20
Please post a precis of the article and leave the link for details. – Iain Feb 21 '13 at 8:21
ok i add more details to the answer – user161054 Feb 21 '13 at 9:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.