2

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 Hybrid gmail MX + postfix for local accounts seems to be somewhat related (though more complicated).

sme
  • 171
  • 2
  • 7

2 Answers2

1

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
sme
  • 171
  • 2
  • 7
1

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
rynop
  • 239
  • 4
  • 16