Bug 1952629

Summary: Logwatch lists sieve "stored mail into mailbox" entries as unmatched
Product: Red Hat Enterprise Linux 8 Reporter: Juan Manuel Santos <jsantos>
Component: logwatchAssignee: Vincent Mihalkovič <vmihalko>
Status: CLOSED ERRATA QA Contact: Karel Volný <kvolny>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.3CC: fsumsal, kvolny
Target Milestone: betaKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: logwatch-7.4.3-11.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 19:39:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Description Flags
Example /var/log/maillog excerpt that triggers the issue none

Description Juan Manuel Santos 2021-04-22 17:12:17 UTC
Description of problem:
When using Dovecot and sieve to deliver emails into mailboxes, the sieve log messages of "stored mail into mailbox"

Version-Release number of selected component (if applicable):
RHEL 8.3

How reproducible:
Every time

Steps to Reproduce:
1. Set up Postfix with Dovecot as LDA, using sieve to filter emails
2. Send an email for local delivery that uses Postfix -> Dovecot LDA -> sieve
3. Wait for the daily logwatch mail message to be sent, or change "Range = yesterday" to "Range = All" in logwatch's configuration, and run /etc/cron.daily/0logwatch

Actual results:

Logwatch sends the sieve "stored mail into mailbox" messages as unmatched entries:

 --------------------- Dovecot Begin ------------------------ 

 **Unmatched Entries**
    dovecot[88830]: lda(user)<88830><66cjAfWmgWD+WgEAzVjm2Q>: sieve: msgid=<20210422164020.E0F59316694D.com>: stored mail into mailbox 'INBOX': 1 Time(s)

Expected results:
Logwatch should not list these messages as unmatched, instead counting them as deliveries:

 --------------------- Dovecot Begin ------------------------ 

 Dovecot Deliveries: 1

Additional info:

After some research, it appears this is already fixed in a newer upstream version:


To test this, line 189 of /usr/share/logwatch/scripts/services/dovecot can be changed from this:

} elsif ( ($User, $Mailbox) = ( $ThisLine =~ /^$dovecottag (?:lda|deliver)\((.*)\): sieve: msgid=.*: stored mail into mailbox '(.*)'/ ) ) {

to this (taken from logwatch 7.5.3 and adapted for 7.4.3 syntax):

} elsif ( ($User, $Mailbox) = ( $ThisLine =~ /^$dovecottag (?:lda|deliver)\((.*)\)(?:<[^>]+><[^>]+>)?: sieve: msgid=.*: stored mail into mailbox '(.*)'/ ) ) {

Comment 4 Karel Volný 2021-05-20 13:00:18 UTC
pls, could you provide sample dovecot log that exhibits the problem, so that I can use it to write a minimal testcase, instead of trying to set up the whole chain with sieve?

Comment 5 Juan Manuel Santos 2021-05-20 13:46:30 UTC
Created attachment 1785183 [details]
Example /var/log/maillog excerpt that triggers the issue

Comment 6 Karel Volný 2021-05-21 09:39:10 UTC
(In reply to Juan Manuel Santos from comment #5)
> Created attachment 1785183 [details]
> Example /var/log/maillog excerpt that triggers the issue

thanks ... only now I have realised that I could have taken the line from the bug description, truncating logwatch's counter

Comment 9 errata-xmlrpc 2021-11-09 19:39:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (logwatch bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.