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

We are looking to send emails that are going out from development box to an email address based on the from address.

If they have the following from

We want to switch the to address to something like
share|improve this question
You're going to need a policy daemon or a milter for that, I think. – Bill Weiss Oct 23 '09 at 20:01
Or you could do something clever like have mail from those addresses sent to a second instance of the smtpd, which redirects everything to devgroup@ . That's probably really complicated. – Bill Weiss Oct 23 '09 at 20:02
up vote 2 down vote accepted

There's a map for that. ;) (apologies to Steve Jobs and Wietse Venema for my lame humour)

Postfix is capable of address rewriting under MANY circumstances. This circumstance would call for the use of the smtpd_sender_restrictions variable in

Effectively, you will be putting a restriction in place to check sender addresses against an access table/db (the map!) you configure, wherein you will tell postfix to redirect to X address if the from address matches Y.

The line in might look like:

smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/devToRewrite

And the contents of /etc/postfix/devToRewrite might look like: REDIRECT

Please keep in mind that rewriting in postfix is very delicate, and you may have configs that could potentially conflict with these intended results.

That being said, some reading to get you started:

As usual, YMMV && HTH.


share|improve this answer

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.