Hello everyone! This time I just want to share with you how I configured sending email notifications from my Proxmox server. This way, I’ll get an email with different notifications, like backups, jobs and tasks.
I’m using a GMail account I created just for this single purpose, so the steps I’ll share in the following paragraphs are using GMail SMTP servers and settings. However, the steps to use another SMTP server should be the same, just changing some key configuration values, so you can take it as a general guide with some care. Let’s jump into it!
Configuring postfix
Postfix is a popular open-source Mail Transfer Agent (MTA) used to send, receive, and deliver email on Unix-like systems. That’s the tool we’ll use to send our mails from Proxmox. First, let’s ensure we have all the dependencies we need. As root, run:
apt install libsasl2-modules postfix-pcreThen, let’s modify some config files. First, let’s indicate postfix to use GMail SMTP server.
# Add the following settings to /etc/postfix/main.cf
# Update existing values if keys exist
relayhost = smtp.gmail.com:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/Entrust_Root_Certification_Authority.pem
smtp_header_checks = pcre:/etc/postfix/smtp_header_checks
# Comment the following line out, or just delete it
# mydestination = $myhostname, localhost.$mydomain, localhostNow, let’s provide postfix the credentials for the server. We do it by generating a /etc/postfix/sasl_passwd file with the email address and the password of the GMail account, in the shape <server>:<port> <email_address>:<password>. The password will likely be your google account password, or an application password if you set up 2FA.
# File /etc/postfix/sasl_passwd
smtp.gmail.com:587 [email protected]:your_passwordAnd the last file we’ll create: provide correct SMTP headers to Postfix, so the sender details will appear correctly on your destination email client. This includes a custom name for the sender (in the example, just My Hostname - Proxmox, but it can be anything), and the sending email address between angle brackets (< >).
# File: /etc/postfix/smtp_header_checks
+ /^From:.*/ REPLACE From: "My Hostname - Proxmox" <[email protected]>Finally, we need to set the correct permissions to the files, update postfix maps, and restart postfix.
chmod 600 /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/smtp_header_checks
postmap /etc/postfix/smtp_header_checks
systemctl restart postfix.serviceAnd that’s all for postfix!
Testing it
To test the mail notifications, form Proxmox VE GUI, go to Datacenter > Notifications. There should be an existing “Notification Target” of type sendmail to notify the root user in its configured email address (set up during ProxmoxVE installation). By selecting that notification target and clicking on “Test” button we should be able to test it.
At this point you should get a test email on your inbox. If it’s not there, although it should not happen because we are using GMail SMTP server which have a good reputation, take a look at your SPAM folder, just in case such an automated test email triggered some SPAM rules. Also, if you are using the same email address as the sender and receiver, it might not appear in your inbox.
Alternative approach
I cannot verify it because I didn’t try this way, but it should be possible to make the same configuration we did for Postfix to use GMail SMTP server just from the Proxmox VE web GUI. For that, you should only need to add a new Notification Target of type SMTP. But as said, I didn’t try it, so take it with a pinch of salt.

