Configure Postfix To Relay Email
Add the following to the end of /etc/postfix/main.cf
smtpd_sasl_auth_enable=yes
smtpd_recipient_restrictions =
permit_sasl_authenticated,
check_relay_domains
broken_sasl_auth_clients = yes
smtpd_sasl_local_domain = $myhostname
sender_canonical_maps = hash:/etc/postfix/canonical
Set inet_interfaces to all in /etc/postfix/main.cf
inet_interfaces = all
edit the /etc/postfix/canonical file to rewrite the “from” address – if you have to deal with some spam filtering issues that dont like the from addresses
root@someserver.mydomain.com hostmaster@mydomain.com
generate the canonical.db file
postmap /etc/postfix/canonical
If needed, create an account to be used to authenticate and relay email
useradd mailrelay
passwd mailrelay
Restart the postfix service
service postfix restart