This instructs postfix to use a third party SMTP server. It’s useful when you want to relay e-mail from an internal server which uses a dynamic IP address.
Ensure postfix is installed, and let’s have all e-mail sent to root relay to an external e-mail address:
nano /etc/postfix/sender_canonicalroot youremail@provider.tldPostfix requires the modifications to be hashed:
postmap hash:/etc/postfix/sender_canonical postconf -e "sender_canonical_maps=hash:/etc/postfix/sender_canonical"Now let’s instruct postfix to use third party SMTP to route e-mail:
nano /etc/postfix/main.cf relayhost = yoursmtp.provider.tld service postfix restartFinally update system aliases:
nano /etc/aliases root: email@domain.tld newaliases