Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have a legacy application that emails via php.

5% of the emails aren't going through. The solution is to route all email through a fancy verified mail server like Amazon's SES. I am having some trouble implementing this functionality.

It seems this guy had a similar problem.

My question is where in postfix can I set a filter that will take as input the the message headers, so that I can manually set the From field and the Reply-To field to and, respectively. Where whatever_php_wants is dictated by the php program and the users registration email.

I know where to set the noreply portion, but I don't know the exact place in postfix's configuration files where I can intercept complete emails and pass them to a script.


So I want emails to look like:

share|improve this question

What you say you want is not what you really want. The headers (From:, Reply-To:, Whatever:) are not used for routing mails. They aren't used for bouncing mails, too. The envelope sender (MAIL FROM) is used for bouncing.

So modifying headers is not the solution to route your bouncing mails.

Additionally it is a VERY VERY bad idea to set the Reply-To: to a non-existent address. You MUST analyze bounces and keep track of them. And don't take others who ignore bouces as role models! They are evil, too. Any yes I know that many Fortune 500 also violate that rule.

share|improve this answer
I don't care about routing mails, the bounces are happening because my old DNS has a really complicated legacy SPF+DKIM setup. I have no intention of setting Reply-To to a non-existent address, just whatever the user's email is. The current problem is that all the emails in the inbox say reply to 'noreply@...' when they should say '', sorry I didn't clarify this... – Mikhail Nov 24 '12 at 0:41

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.