POSTFIX how to use a relayserver just for a specific domain?

you cannot use transport as it is used to transport emails to the MAILBOX, you need to use

sender_dependent_relayhost_maps

it works like this in your main.cf:

relayhost = mx1.example.org, mx2.example.org 
relay_domains = example.com, example.org, example.net

smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/relaymap

/etc/postfix/relaymap looks like this :

@example.com    mx1.example.com
@example.net    mx1.example.com

@example.org    mx2.example.com

Tags:

Postfix