https://wiki.debian.org/UnattendedUpgrades
https://geekistheway.com/2021/03/07/configuring-e-mail-alerts-on-your-proxmox/
apt update
apt install -y libsasl2-modules
set YOUR_GMAIL_USERNAME=
set YOUR_GMAIL_APP_PASSWORD=
echo "smtp.gmail.com [email protected]:$YOUR_GMAIL_APP_PASSWORD" > /etc/postfix/sasl_passwd
postmap hash:/etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd
sed -i 's/relayhost\ =/relayhost\ =\ smtp.gmail.com:587/g' /etc/postfix/main.cf
tee -a /etc/postfix/main.cf >/dev/null <<'EOF'
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
EOF
postfix reload
echo "My Test Message" | mail -s "Test from $(hostname)" [email protected]