https://technotim.live/posts/proxmox-alerts/
apt update
apt install -y libsasl2-modules mailutils
echo "smtp.gmail.com psfrwrd.ricostuart@gmail.com:[APP-PASSWORD]" > /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd
postmap hash:/etc/postfix/sasl_passwd
nano /etc/postfix/main.cf
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
postfix reload
echo "This is a test message sent from postfix on my Proxmox Server" | mail -s "Test Email from Proxmox" psfrwrd.ricostuart@gmail.com
apt update
apt install postfix-pcre
nano /etc/postfix/smtp_header_checks
/^From:.*/ REPLACE From: pve1-alert pve1-alert@epnet.work
postmap hash:/etc/postfix/smtp_header_checks
cat /etc/postfix/smtp_header_checks.db
nano /etc/postfix/main.cf
smtp_header_checks = pcre:/etc/postfix/smtp_header_checks
postfix reload
https://technotim.live/posts/proxmox-alerts/
apt update
apt install -y libsasl2-modules mailutils
echo "smtp.gmail.com psfrwrd.ricostuart@gmail.com:[APP-PASSWORD]" > /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd
postmap hash:/etc/postfix/sasl_passwd
nano /etc/postfix/main.cf
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
postfix reload
echo "This is a test message sent from postfix on my Proxmox Server" | mail -s "Test Email from Proxmox" psfrwrd.ricostuart@gmail.com
apt update
apt install postfix-pcre
nano /etc/postfix/smtp_header_checks
/^From:.*/ REPLACE From: pve1-alert pve1-alert@epnet.work
postmap hash:/etc/postfix/smtp_header_checks
cat /etc/postfix/smtp_header_checks.db
nano /etc/postfix/main.cf
smtp_header_checks = pcre:/etc/postfix/smtp_header_checks
postfix reload