Configuring your Postfix to use smarthost


Routing all mails to a smarthost :

assume the postfixconfig files live in /etc/postfix/

In/etc/postfix/ add the line:

relayhost = my.smarthost.fqdn:587

Routing all mails for a specific domain to a smarthost :

Add a line to /etc/postfix/transport: my.smarthost.fqdn:587

generate a postmap file :

postmap hash:/etc/postfix/transport

To use the transport file, add or edit a line in /etc/postfix/

transport_maps = hash:/etc/postfix/transport

Restart Postfix and all mail. The mail for selected domains should go trough the Smarthost.

* Some MTA accepts mail submission on port 587 only while some accepts on port 25 only.