Bug 525903 - Error in RE that matches "lost connection" lines in postfix script
Summary: Error in RE that matches "lost connection" lines in postfix script
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: logwatch
Version: 11
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Karel Klíč
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-26 22:21 UTC by Richard Fearn
Modified: 2013-03-03 22:59 UTC (History)
4 users (show)

Fixed In Version: 7.3.6-46.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-01-19 01:02:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
entries from my maillog (567 bytes, text/plain)
2009-09-26 22:22 UTC, Richard Fearn
no flags Details

Description Richard Fearn 2009-09-26 22:21:29 UTC
Description of problem:

Line 1539 of /usr/share/logwatch/scripts/services/postfix:

elsif ( ($reason,$host,$hostip) = ($p1 =~ /lost connection (after [^ ]*) (\(\d+ bytes\) )?from ([^[]*)\[($re_IP|unknown)\]$/o )) {

Not all "lost connection" lines in /var/log/maillog have the "(xxx bytes)" part (examples attached.) It needs to be non-capturing:

(?:\(\d+ bytes\)

As it is now, if "(xxx bytes)" is present it will be captured as $host, and $hostip will be the hostname. This causes errors in the values reported for "*Warning: Pre-queue content-filter connection overload" and "Connections lost", which are both based on "lost connection" messages.

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

logwatch-7.3.6-44.fc11.noarch

How reproducible:

Every day

Steps to Reproduce:
1. Get "lost connection" messages in /var/log/maillog
2. Get incorrect values in the logwatch mail, as described above
  
Actual results:

Incorrect values

Expected results:

Correct values!

Additional info:

The logwatch script is getting quite old... it would be a good idea to replace it with the latest from http://www.mikecappella.com/logwatch/.

I've sent a message to the logwatch-devel list to see if they have any plans to release a new version any time soon.

Comment 1 Richard Fearn 2009-09-26 22:22:19 UTC
Created attachment 362788 [details]
entries from my maillog

Comment 2 Mike Cappella 2009-09-26 23:33:10 UTC
Richard,

Thanks.  This was resolved some time ago, I don't recall when.  Certainly it is resolved in the latest version 1.38.01.  Capturing is OK, but just needs to be handled correctly.  As you've mentioned, the version in logwatch is now very old.

$ postfix-logwatch  --version
postfix-logwatch: 1.38.01

$ cat log.connectionlost
Sep 26 16:06:16 glacier postfix/smtpd[27000]: lost connection after DATA from unknown[192.168.0.134]
Sep 26 16:06:16 glacier postfix/smtpd[27000]: lost connection after CONNECT from mail.example.com[192.168.0.1]

# postfix 2.5:20071003
Sep 26 16:06:16 glacier postfix/smtpd[27000]: lost connection after DATA (494133 bytes) from localhost[127.0.0.1]

# postfix 2.6:20080621                                       
Sep 26 16:06:16 glacier postfix/smtpd[27000]: lost connection after DATA (approximately 0 bytes) from example.com[10.0.0.1]

$ postfix-logwatch -l connectionlostinbound=10 --max_report=70 log.connectionlost
****** Summary *******************************************************

       4   Connections lost (inbound) 

****** Detail (10) ***************************************************

       4   Connections lost (inbound) --------------------------------
       3      After DATA
       1         10.0.0.1         example.com
       1            0
       1         127.0.0.1        localhost
       1            494,133
       1         192.168.0.134    unknown
       1      After CONNECT
       1         192.168.0.1      mail.example.com

As for the logwatch project including the latest versions, there are license differences preventing inclusion:  http://www.mikecappella.com/logwatch/faq.html#comparison

However, the Fedora project is free to include updates via their patch mechanism so long as the postfix-logwatch license and man page is included.

@ivana - OK to ping me w/any bug reports re: postfix-logwatch/amavis-logwatch (eg. the postfix and amavis filters in logwatch).

Comment 3 Karel Klíč 2009-12-16 12:42:13 UTC
Thanks.

The fix for this problem is in the CVS, adding :? seems to work well.
The update will follow shortly.

Mike, regarding the postfix-logwatch and amavis-logwatch packages: in my opinion those should be packaged separately from logwatch, because it's another upstream (you), separate versioning, and different licenses.

Comment 4 Fedora Update System 2009-12-16 16:25:10 UTC
logwatch-7.3.6-46.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/logwatch-7.3.6-46.fc11

Comment 5 Fedora Update System 2009-12-16 16:27:11 UTC
logwatch-7.3.6-49.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/logwatch-7.3.6-49.fc12

Comment 6 Fedora Update System 2009-12-18 04:47:03 UTC
logwatch-7.3.6-46.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update logwatch'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-13395

Comment 7 Fedora Update System 2010-01-19 00:59:57 UTC
logwatch-7.3.6-49.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2010-01-19 01:02:38 UTC
logwatch-7.3.6-46.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.