Chinese Yellow Pages | Classifieds | Knowledge | Tax | IME

Background/Use case

sometimes we need want to based on the destimation/domain to use different STMP server ( instead of relying on automatically search mx record)

the transport_maps is a good way do that:

 

https://www.postfix.org/STANDARD_CONFIGURATION_README.html
12 transport_maps = hash:/etc/postfix/transport 13 17 . . . 18 19 /etc/postfix/transport: 20 example.com relay:[inside-gateway.example.com]

complete example:

 

routing gmail using stmp.gmail.com
others use default postfix transport

….

# relayhost =
transport_maps = hash:/etc/postfix/transport

smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd
smtp_sasl_security_options = noanonymous

# more transport
gmail.com relay:[smtp.gmail.com]:587

cat /etc/postfix/sasl/passwd

[smtp.gmail.com]:587 your@gmail.com:ttif gmails_app_pwd

postmap transport

postmap sasl/passwd

/etc/init.d/postfix restart

Leave a Reply

Your email address will not be published. Required fields are marked *