Re: Bug#541152: logwatch: uw-imapd, unmatched log entries

Willi Mann <[email protected]>
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
Hi!

Here is a patch for the imapd service script by Marcin Szewczyk. Not
verified by me, I don't use imap.

Willi

Marcin Szewczyk, Wodny schrieb:
> Package: logwatch
> Version: 7.3.6.cvs20080702-2
> Severity: wishlist
> Tags: patch
> 
> uw-imapd generates lines unmatched by rules in the imapd service script.
> Patch included.
> 
> 
> -- System Information:
> Debian Release: squeeze/sid
>   APT prefers unstable
>   APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
> Architecture: i386 (i686)
> 
> Kernel: Linux 2.6.30-1-686 (SMP w/2 CPU cores)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
>

_______________________________________________
Logwatch-Devel mailing list
[email protected]
http://www2.list.logwatch.org:81/mailman/listinfo/logwatch-devel
imapd.patch (text/x-patch, 1.4 KB)
--- /usr/share/logwatch/scripts/services/imapd	2008-12-31 12:31:13.000000000 +0100
+++ imapd	2009-08-05 23:25:09.078394758 +0200
@@ -38,7 +38,10 @@
       ($ThisLine =~ /^couriertls: read: Connection reset by peer/ ) or
       # timeouts are reported in some other scripts - maybe it should be here too?
       ($ThisLine =~ /^couriertls: read: Connection timed out/ ) or
-      ($ThisLine =~ /^LOGOUT, ip=\[(.*)\], rcvd=\d+, sent=\d+$/)
+      ($ThisLine =~ /^LOGOUT, ip=\[(.*)\], rcvd=\d+, sent=\d+$/) or
+      # uw-imapd
+      ($ThisLine =~ /^Moved \d+ bytes of new mail to.*$/) or
+      ($ThisLine =~ /^Unexpected client disconnect, while reading line.*$/)
    ) {
       # Don't care about these...
    } elsif ( ($User, $Host) = ( $ThisLine =~ /^Login user=(.*?) host=(.*\[.*\])$/ ) ) {
@@ -67,6 +70,10 @@
    } elsif ( ($User, $Host) = ( $ThisLine =~ /^Logout user=(.*?) host=(.*\[.*\])$/) ) {
       $Logout{$User}{$Host}++;
       $Logout2{$User}++;
+   # More generic pattern for uw-imapd
+   } elsif ( ($User, $Host) = ( $ThisLine =~ /^Logout user=(.*?) host=(.*)$/) ) {
+      $Logout{$User}{$Host}++;
+      $Logout2{$User}++;
    } elsif ( ($dummy, $User, $Host, $DownloadSize1, $DownloadSize2) = ( $ThisLine =~ /^(LOGOUT|TIMEOUT|DISCONNECTED), user=(.*?), ip=\[([^ ,]+)\](?:, port=\[\d+\])?, headers=(\d+), body=(\d+)/o ) ) {
       $Logout{$User}{$Host}++;
       $Logout2{$User}++;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.