Skip to content
Menu
Marius Serbanica – Tech Blog
  • My Tech Blog
  • About me
  • Contact Me
  • Curriculum Vitae
  • Projects
  • Current Projects List
  • Certifications
  • Home Lab
  • Self-Hosted
  • Linux Cheat Sheet
  • Linux Commands
  • Privacy Policy
  • Site Map
Marius Serbanica – Tech Blog
December 9, 2023

Tutorial for ProxMox E-Mail Alerts

Setting up alerts in Proxmox is critical to making sure you are notified if something goes wrong with your servers. It’s so easy, I should have done this years ago! In this tutorial, we’ll set up email notifications using SMTP with Gmail or G Suite that send email alerts when there are disk errors, ZSF Issues, or when backup jobs run. We’ll then test the alerts to make sure they are working by yoinking a drive from my ZFS pool (and hopefully it doesn’t fail).

install dependencies –

apt update
apt install -y libsasl2-modules mailutils
ShellSession

Configure app passwords on your Google account

https://myaccount.google.com/apppasswords

Configure postfix

echo "smtp.gmail.com [email protected]:YourAppPassword" > /etc/postfix/sasl_passwd
ShellSession

update permissions

chmod 600 /etc/postfix/sasl_passwd
ShellSession

hash the file

postmap hash:/etc/postfix/sasl_passwd
ShellSession

check to be sure the db file was created

cat /etc/postfix/sasl_passwd.db
ShellSession

edit postfix config

nano /etc/postfix/main.cf
ShellSession
# google mail configuration

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_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache
smtp_tls_session_cache_timeout = 3600s
ShellSession

reload postfix

postfix reload
ShellSession

send a test email

echo "This is a test message sent from postfix on my Proxmox Server" | mail -s "Test Email from Proxmox" [email protected]
ShellSession

edit name in email

install dependency

apt update
apt install postfix-pcre
ShellSession

edit config

nano /etc/postfix/smtp_header_checks
ShellSession

add the following text

/^From:.*/ REPLACE From: pve1-alert <[email protected]>
ShellSession

hash the file

postmap hash:/etc/postfix/smtp_header_checks
ShellSession

check the contents of the file

cat /etc/postfix/smtp_header_checks.db
ShellSession

add the module to our postfix config

nano /etc/postfix/main.cf
ShellSession

add the following to the end of the file

smtp_header_checks = pcre:/etc/postfix/smtp_header_checks
ShellSession

reload postfix service

postfix reload
ShellSession

Share on Social Media
x facebook linkedin

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Join my LinkedIn Network.

Recent Posts

  • Kubernetes cluster. Why and how
  • Installing GNU-World on ircu2
  • Replacing Cloudflare Tunnel with Tailscale on a VPS
  • KASM – My main workspace RBI
  • Transforming a Mini PC into a Powerful Home Network Hub / Router/ Firewall with OPNsense

Archives

  • February 2025
  • January 2025
  • October 2024
  • May 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023

Categories

  • How-To
  • Tech Industry
  • Tech, but personal
  • Tutorials

Recent Comments

  1. IRC Lamer on Installing GNU-World on ircu2
  2. severus2231 on Transforming a Mini PC into a Powerful Home Network Hub / Router/ Firewall with OPNsense
  3. admin on Mounting a NAS (Network Attached Storage) device on Linux
  4. abL on Mounting a NAS (Network Attached Storage) device on Linux
  5. Alin R on Cleaning up your Linux OS.
Social Media
Find me on social media
Facebook Twitter Instagram LinkedIn

©2025 Marius Serbanica – Tech Blog