Forward all emails from one domain to the same external domain (dont try to delivery internally)

Add this to the file /etc/postfix/main.cf:

transport_maps = hash:/etc/postfix/transport_maps

Then create the file /etc/postfix/transport_maps containing the specific address (you can try the wildcard) and the server to send the emails:

user1@example.com smtp:aspmx.l.google.com
user2@example.com smtp:aspmx.l.google.com

After, run postmap and restart postfix:

postmap /etc/postfix/transport_maps
service postfix restart

1 Like