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 configured my postfix server to relay all received mails to smtp.example.com 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 script@domain.net (or also the whole domain: domain.net) 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 http://www.postfix.org/transport.5.html

Thanks!!

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

1 Answer 1

up vote 0 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

 
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.