Had to do this myself, so here’s a quick guide on setting up proxmox to send e-mail notifications via your e-mail service of choice – particularly useful for backup notifications. I use MXRoute myself but it should work with just about any service, with some tweaking required for services like Gmail where you need a special password.
First, make sure that your e-mail addresses are configured correctly. In Datacenter > Permissions > Users, select your user (probably root) and make sure the e-mail field is set to the e-mail you want to receive your notification at. After that, in Datacenter > Options, set the e-mail from address to be that which proxmox will use to send e-mail from e.g.
Then, in a terminal, install a required authentication package:
apt install libsasl2-modules -y
Then modify the postfix configuration at /etc/postfix/main.cf to contain the following, as appropriate for your mail server configuration:
relayhost = echo.mxrouting.net:587 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtpd_sasl_authenticated_header = yes smtp_tls_security_level = encrypt
Note that you might have to comment out any existing lines pertaining to relayhost or mydestination. You may also change the port (587) as desired; the default is 25 which may be blocked by default on some ISPs as it is the port mail servers communicate to each other on and often used for spam. Next, create the file /etc/postfix/sasl_passwd with the following content modified as appropriate again:
Run the following commands to ensure no one else can read that password and generate a hash of it for postfix to read:
chown root:root /etc/postfix/sasl_passwd chmod 0600 /etc/postfix/sasl_passwd postmap hash:/etc/postfix/sasl_passwd
Lastly, restart postfix:
systemctl restart postfix
You should be able to send a test-email through proxmox now:
echo "Test email from Proxmox: $(hostname)" | /usr/bin/proxmox-mail-forward
Note that this guide is adapted from i12bretro’s tutorial, which is good but a bit out of date and specifies some options that from some limited testing I did don’t work with MXRoute. As such, I adapted the settings provided by Jarland, the owner of MXRoute. As Postfix is used as an e-mail sender for a lot of services, and MXRoute is not particularly special when it comes to e-mail server settings, this guide should work for a lot of other e-mail services and software distributions/packages like Proxmox.