Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

3 Answers 3

http://www.postfix.org/MILTER_README.html
There is a PHP milter SAPI. (I know nothing about it.)

share|improve this answer

I'd also like to know how to do this, I would like an example of how to do it from somebody who knows, I can get the email to send to the php script by following this tutorial:

http://blog.thecodingmachine.com/content/triggering-php-script-when-your-postfix-server-receives-mail

but I can't figure out how to get the email to go back to postfix to be delivered like normal afterwards.

this is for a situation where I want to read email and store to database those which match a specific set of rules, but I don't want to interfere with normal delivery, my filter is passive I suppose you could say.

share|improve this answer

http://moshez.blogspot.co.il/2013/02/techpostfix-mail-server-filter-email-by.html
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
1  
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

 
discard

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.