proxmox 警告設定

來源
#https://technotim.live/posts/proxmox-alerts/?fbclid=IwY2xjawHzFrBleHRuA2FlbQIxMAABHdkAGaE4zXeT-vDVdc94xwMxPgnF66rx6Irqpz71U4pdbI0_cdUTplKVHQ_aem_5MyfHsJ9-dzlLbGShgH76Q

1.
apt install -y libsasl2-modules mailutils

2.
echo "smtp.gmail.com your-email@gmail.com:YourAppPassword" > /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd
postmap hash:/etc/postfix/sasl_passwd

3.
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
systemctl postfix reload

4.
測試信
echo "This is a test message sent from postfix on my Proxmox Server" | mail -s "Test Email from Proxmox" your-email@gmail.com

#修改信件抬頭
1.
apt install postfix-pcre

2.
vi /etc/postfix/smtp_header_checks
/^From:.*/ REPLACE From: pve1-alert postmap hash:/etc/postfix/smtp_header_checks

vi /etc/postfix/main.cf
smtp_header_checks = pcre:/etc/postfix/smtp_header_checks
systemctl postfix reload

本篇發表於 proxmox。將永久鍊結加入書籤。

發表迴響

您的電子郵件位址並不會被公開。 必要欄位標記為 *

*

您可以使用這些 HTML 標籤與屬性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>