-
配置好
postfix
。 -
安装
logwatch
:sudo apt install logwatch
-
配置 Logwatch:
sudoedit /usr/share/logwatch/default.conf/logwatch.conf
MailTo = example@gmail.com # 改为你 postfix 配置的发件人 MailFrom = example@gmail.com # 改为实际收件人 Range = yesterday Detail = Low Service = All DailyReport = Yes Output = mail Format = html
-
发送测试日志:
sudo logwatch --detail Low --mailto example@gmail.com --service All --range All
参考:How To Install and Use Logwatch Log Analyzer and Reporter on a VPS | DigitalOcean
参见:Linux 使用 SMTP 发送邮件 | 博客园