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.

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

If they have the following from

sales@domain.com info@domain.com support@domain.com

We want to switch the to address to something like devgroup@domain.com

Thanks!

share|improve this question
1  
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
add comment

1 Answer

up vote 1 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 main.cf.

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 main.cf might look like:

smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/devToRewrite

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

sales@domain.com REDIRECT devgroup@domain.com

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
add comment

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.