我已经安装了Debian10 (Buster)和dovecot、sieve和logwatch。
在我的筛子文件中,我对discard有规则。因此,我在syslog文件中获得了大量以下行。
Nov 2 19:46:17 xxxxx dovecot: lda(xxxxx)<12473>: sieve: msgid=<20201102184616.329F346C0BD1@smtp.xxxxx.net>: marked message to be discarded if not explicitly delivered (discard action)在日志观察报告中,我看到
**Unmatched Entries**
dovecot: lda(xxxxx)<1003>: sieve: msgid=<20201103163403.E5FB546C0BD8@smtp.xxxxx.net>: marked message to be discarded if not explicitly delivered (discard action): 1 Time(s)
...我在/usr/share/ logwatch /script/services/ dovecot中检查了logwatch的dovecot过滤器代码,并且存在忽略这些消息的规则,但显然不起作用。
这就是我在脚本文件中找到的:
} elsif ( $ThisLine =~ /^$dovecottag (?:lda|deliver|lmtp)\(.*\): .*sieve: msgid=.* marked message to be discarded if not explicitly delivered/ ) {
# dovecot: lda(joe): sieve: msgid=: marked message to be discarded if not explicitly delivered (discard action)
# IGNORE
}我的dovecot版本是2.3.4.1。我的日志表版本是7.4.3。
发布于 2020-11-07 14:00:18
通过测试“体外”,我发现由于<1003>的存在,脚本规则失败了。规则匹配如果我删除它。
通过插入.*解决了这个问题。这是固定的规则
} elsif ( $ThisLine =~ /^$dovecottag (?:lda|deliver|lmtp)\(.*\).*: .*sieve: msgid=.* marked message to be discarded if not explicitly delivered/ ) {
# dovecot: lda(joe): sieve: msgid=: marked message to be discarded if not explicitly delivered (discard action)
# IGNORE
}我在Dovecot2.3.4.1和Logwatch 7.4.3中使用Debian 10。这不是Logwatch的最新版本,而是Debian上默认安装apt的版本。
发布于 2021-02-18 17:11:58
在升级到Debian 10之后,我也遇到了这个问题。
默认情况下,dovecot2.3.4.1的日志前缀更改为包含pid和会话。Buster的Logwatch版本(7.4.3)没有考虑到这一点,这会导致许多不匹配的条目和错误没有分组在一起。(您可以在/usr/share/logwatch/scripts/services/dovecot查看dovecot的规则)即使是Logwatch的最新版本7.5.5在撰写本文时,似乎也没有针对每一种可能性的修正规则。
对我来说,最有效的方法是从dovecot的日志前缀中删除pid和会话。
将mail_log_prefix选项在/etc/dovecot/conf.d/10-logging.conf中更改为
# Log prefix for mail processes. See doc/wiki/Variables.txt for list of
# possible variables you can use.
#mail_log_prefix = "%s(%u)<%{pid}><%{session}>: "
# remove pid and session for compatability with logwatch
mail_log_prefix = "%s(%u): " 重新启动dovecot以使更改生效
systemctl restart dovecothttps://unix.stackexchange.com/questions/617981
复制相似问题