Jam*_*mes 6 email email-server smtp logwatch ssmtp
我已经通过今天在我的服务器上设置 Logwatch 并成功安装了这一切。
我在 Digital Ocean 上遵循了本指南并将MailFrom
参数设置为:
MailFrom = mailer@mydomain.com
我正在使用 ssmtp 使用我的 Postmark App 帐户发送电子邮件,它正在通过我的 Postmark 活动源,但它显示“发件人”字段被设置为 root。
Personaladdress@hotmail.com 的 SMTP API 错误:“发件人”地址无效:“root”。
查看尝试发送的电子邮件的原始来源,它显示了这一行:
From: root
这是我用来生成发送的命令:
sudo logwatch --detail Low --mailto personaladdress@hotmail.com --service http --range today
我哪里出错了,或者我该怎么做才能让它发送,mailer@mydomain.com
因为 Postmark 要求正确发送发件人地址,否则它将不允许它通过并返回错误
更多细节
Logwatch 版本:Logwatch 7.4.0 (released 03/01/11)
系统:Debian 8 (Jessie)
在我的服务器上使用 sSMTP 从 Postmark 调试日志发送电子邮件:
Config After Command Line Parsing:
supress_ignores -> 0
pathtozcat -> zcat
html_header -> /usr/share/logwatch/default.conf/html/header.html
logdir -> /var/log
hostlimit ->
encode -> none
subject ->
mailfrom -> root
format -> html
numeric -> 0
tmpdir -> /tmp
html_wrap -> 80
pathtobzcat -> bzcat
detail -> 0
range -> yesterday
hostformat -> none
debug -> 10
output -> mail
mailer -> /usr/sbin/sendmail -t
hostname -> game
html_footer -> /usr/share/logwatch/default.conf/html/footer.html
archives -> 1
pathtocat -> cat
mailto -> personal@hotmail.com
filename ->
Run Code Online (Sandbox Code Playgroud)
经过大量调查,我已经找到了原因。
Logwatch 处理/usr/share/logwatch/dist.conf/logwatch.conf
后处理/usr/share/logwatch/default.conf/logwatch.conf
。
里面/usr/share/logwatch/dist.conf/logwatch.conf
是三个配置行:
mailer
TmpDir
MailFrom
正是在这里MailFrom
设置了root
导致问题的地方。更新后mailer@example.com
一切正常!