meta data for this page
This is an old revision of the document!
Relay to external SMTP server
Simple postfix configuration script
apt-get install postfix bsd-mailx wget https://raw.githubusercontent.com/Tontonjo/proxmox/master/ez_proxmox_mail_configurator.sh bash ez_proxmox_mail_configurator.sh
Manual configuration
# Specify zero or more "type:name" lookup tables. Type is a service defined in master.cf cloudservice@example.org [smtp.gmail.com]:587
cd /etc/postfix && postmap relay_by_sender
- /etc/postfix/sasl_passwd
[smtp.gmail.com]:587 myrealsender@gmail.com:secret_password
cd /etc/postfix && postmap sasl_passwd sudo chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db sudo chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
- main.cf
... # A sender-dependent override for the global relayhost parameter setting sender_dependent_relayhost_maps = hash:/etc/postfix/relay_by_sender smtp_sender_dependent_authentication = yes smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous
service postfix restart
Test email:
cat /etc/issue | mailx -r "cloudservice@example.org" -s "test relaya" "destination@email.org"
Issues
(SASL authentication failed; cannot authenticate to server smtp.server.org[11.22.33.44]: no mechanism available) solution: smtp_sasl_security_options = noanonymous