Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want to achieve the following with postfix:

Almost all outgoing emails shall be sent via a relayhost, configured in main.cf with

relayhost = my.mailserver

There's one specific email address (bugs@mydomain.com) for which I want the email to be delivered locally. I set up a local account on the machine to match the email address and added "mydomain.com" to the mydestination property in main.cf. Then of course postfix tries to deliver every email to @mydomain.com locally and bounces them because the respective user doesn't exist.

Question http://serverfault.com/questions/149453/hybrid-gmail-mx-postfix-for-local-accounts seems to be somewhat related (though more complicated).

share|improve this question

2 Answers 2

I finally figured out the correct syntax in the transport configuration file:

Add the following to /etc/posfix/transport:

bugs@mydomain.com :
*    relay:[my.mailserver]

and run

postmap transport
postfix reload
share|improve this answer
hmm this does not work for me - still relays 'bugs@mydomain.com'. –  rynop Jan 23 '13 at 22:13

The correct way to do this is add the following to /etc/posfix/transport

bugs@mydomain.com local:
*     relay:[my.mailserver]

Then add the following to /etc/postfix/main.cf:

transport_maps = hash:/etc/postfix/transport

Then run:

sudo postmap hash:/etc/postfix/transport
sudo /etc/init.d/postfix restart
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.