首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >多维柯筛不适用的LogWatch滤波规则

多维柯筛不适用的LogWatch滤波规则
EN

Unix & Linux用户
提问于 2020-11-04 13:33:45
回答 2查看 338关注 0票数 0

我已经安装了Debian10 (Buster)和dovecotsievelogwatch

在我的筛子文件中,我对discard有规则。因此,我在syslog文件中获得了大量以下行。

代码语言:javascript
复制
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)

在日志观察报告中,我看到

代码语言:javascript
复制
**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过滤器代码,并且存在忽略这些消息的规则,但显然不起作用。

这就是我在脚本文件中找到的:

代码语言:javascript
复制
   } 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。

EN

回答 2

Unix & Linux用户

回答已采纳

发布于 2020-11-07 14:00:18

通过测试“体外”,我发现由于<1003>的存在,脚本规则失败了。规则匹配如果我删除它。

通过插入.*解决了这个问题。这是固定的规则

代码语言:javascript
复制
   } 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的版本。

票数 0
EN

Unix & Linux用户

发布于 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中更改为

代码语言:javascript
复制
# 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以使更改生效

代码语言:javascript
复制
systemctl restart dovecot
票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/617981

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档