我今天已经完成了在我的服务器上安装Logwatch,并且已经成功地安装了这些。
我跟踪了数字海洋上的本指南,并将MailFrom参数设置为:
MailFrom = mailer@mydomain.com
我正在使用ssmtp发送电子邮件使用我的邮戳应用帐户,它是通过我的邮戳活动提要,但它显示从字段设置为根。
Personaladdress@hotmail.com的SMTP API错误:无效“从”地址:“根”。
查看试图发送的电子邮件的原始来源,它显示了以下一行:
From: root
这是我用来生成发送的命令:
sudo logwatch --detail Low --mailto personaladdress@hotmail.com --service http --range today
我在哪里出错,或者如何使它发送,因为mailer@mydomain.com作为邮戳要求正确发送from地址,否则它将不允许它通过并返回一个错误
Logwatch版本:Logwatch 7.4.0 (released 03/01/11)
系统: Debian 8 (Jessie)
使用我服务器上的sSMTP从邮戳调试日志发送电子邮件:
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 ->发布于 2016-05-05 01:08:45
经过一吨的调查,我找到了原因。
Logwatch在处理/usr/share/logwatch/dist.conf/logwatch.conf之后处理/usr/share/logwatch/default.conf/logwatch.conf。
/usr/share/logwatch/dist.conf/logwatch.conf内部有三条配置行:
mailerTmpDirMailFrom正是在这里,MailFrom被设置为root,从而引发了这些问题。在更新到mailer@example.com之后,一切都很好!
发布于 2017-03-02 08:55:03
不幸的是,数字海洋文章在一个重要的问题上是误导的。在编辑之前,应该复制logwatch配置文件(例如,https://help.ubuntu.com/community/Logwatch),使其成为/etc/logwatch/conf/logwatch.conf。如果在/etc位置有一个配置文件,logwatch将优先于默认的/etc文件(甚至忽略默认值,我不确定是哪个)。在下面的评论中提到了这一点,但是和您一样,在开始实现之前,我没有读过这些评论。我就是这样在这里结束的!
发布于 2017-03-12 15:54:22
您应该在/etc/logwatch/conf/logwatch.conf中设置您的配置。
这将覆盖/usr/share/logwatch/dist.conf/logwatch.conf和/usr/share/logwatch/default.conf/logwatch.conf。
来自http://ftp.logwatch.org/tabs/docs/HOWTO-Customize-LogWatch.html
但是,Logwatch,从7.0版开始,实现了一种机制,允许更容易地修改本地系统。这些修改可能是因为写入到系统日志的服务的配置已从其默认值更改,或者因为Logwatch用户更喜欢报告的内容或Logwatch报告的方式不同。您可以通过修改/etc/ logwatch /conf目录中的变量来自定义logwatch的输出。默认值在/usr/share/logwatch/default.conf目录中指定。您的发行版可能在/usr/share/logwatch/dis.conf目录中设置了其他默认值。所有可用变量都在这些目录下的文件中声明。您可以更改默认值以修改使用logwatch显示的方式或内容。
https://serverfault.com/questions/774716
复制相似问题