# mkdir -p /etc/postfix/sasl
- Add the following parameters to the end of
/etc/postfix/main.cf:
myhostname = localhost.example.com
inet_interfaces = loopback-only
mynetworks = 127.0.0.0/8
relayhost = [smtp.example.net]:587
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
smtp_tls_security_level = may
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
sender_canonical_maps = regexp:/etc/postfix/sender_canonical_maps
- Put to
/etc/postfix/sasl/sasl_passwd the login data of the SMTP host:
[smtp.example.net]:587 username:password
# postmap /etc/postfix/sasl/sasl_passwd
- Put your SMTP host address to
/etc/postfix/sender_canonical_maps:
/.+/ user@example.net
# postmap /etc/postfix/sender_canonical_maps
- Add something like
root: user
user: user@example.org
- to the end of
/etc/aliases; then run the command newaliases