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 configured my postfix server to relay all received mails to with relayhost. This server doesn't accept mails from an external source. So only scripts are sending mails.

Is it possible to configure postfix that all mails with a specific mail address in FROM field, like (or also the whole domain: are send directly by the server to the corresponding mx server for the TO-address, instead of using the specified relay host?

I found one possibility to specify a specific host if a specific mail address is in the TO field, but not the FROM field: How can I configure Postfix to ignore relayhost for some domains? and


share|improve this question
or also the other way around is possible where all mails with in from field are relayed to a specific host, all others sent directly. – SailAvid Oct 10 '12 at 16:04
up vote 1 down vote accepted

You didn't look closely enough.

You'll want sender_dependent_relayhost_maps or one of the things that override it.

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.