大网数据广告活动
服务器运维问答

Logwatch is not respecting MailFrom

· 52CE 我爱测

I've gone through today to setup Logwatch on my server and have installed this all successfully. I've followed this guide on Digital Ocean and set the MailFrom parameter to: MailFrom = [email omitted] I'm using ssmtp to send emai…

问题原文

原帖链接 · James · CC BY-SA 3.0

I've gone through today to setup Logwatch on my server and have installed this all successfully.

I've followed this guide on Digital Ocean and set the MailFrom parameter to:

MailFrom = [email omitted]

I'm using ssmtp to send emails using my Postmark App account and it is coming through on my Postmark activity feed but it is showing the From field being set as root.

SMTP API Error for [email omitted]: Invalid 'From' address: 'root'.

Looking at the raw source of the email trying to be sent it shows this line:

From: root

This is the command I am using to generate the send:

sudo logwatch --detail Low --mailto [email omitted] --service http --range today

Where am I going wrong or what can I do to get it sending as [email omitted] as Postmark require the from address to be correctly sent otherwise it won't allow it through and returns an error

Further details

Logwatch version: Logwatch 7.4.0 (released 03/01/11)
System: Debian 8 (Jessie)
Using sSMTP on my server to send emails from Postmark Debug log:

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 -> [email omitted]
filename ->

社区高分解答

原帖链接 · mbrampton · CC BY-SA 3.0

Unfortunately the Digital Ocean article is misleading on an important point. The logwatch configuration file should be copied (see e.g. https://help.ubuntu.com/community/Logwatch) to become /etc/logwatch/conf/logwatch.conf before being edited. Provided there is a config file at the /etc location, logwatch will prioritise the /etc file over the defaults (or even ignore the defaults, I'm not sure which). This is mentioned in the comments below the article, but like you, I didn't read the comments before going ahead with implementation. That's how I finished up here!

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-05-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。