diff --git a/logwatch-dovecot-proxy.patch b/logwatch-dovecot-proxy.patch new file mode 100644 index 0000000..b4d6b13 --- /dev/null +++ b/logwatch-dovecot-proxy.patch @@ -0,0 +1,79 @@ +Index: scripts/services/dovecot +=================================================================== +--- scripts/services/dovecot (revision 100) ++++ scripts/services/dovecot (revision 101) +@@ -198,6 +198,24 @@ + $Connection{$Host}++; + } + ++ # Dovecot 2.0 proxy ++ } elsif ( ($User, $Host) = ( $ThisLine =~ /^$dovecottag pop3-login: proxy\((.*)\): started proxying to .*: user=<.*>, method=.*, rip=(.*), lip=/ ) ) { ++ if ($Host !~ /$IgnoreHost/) { ++ $ProxyLogin{$User}{$Host}++; ++ $ProxyLoginPOP3{$User}++; ++ $ProxyConnectionPOP3{$Host}++; ++ $ProxyConnection{$Host}++; ++ } ++ } elsif ( ($User, $Host) = ( $ThisLine =~ /^$dovecottag imap-login: proxy\((.*)\): started proxying to .*: user=<.*>, method=.*, rip=(.*), lip=/ ) ) { ++ if ($Host !~ /$IgnoreHost/) { ++ $ProxyLogin{$User}{$Host}++; ++ $ProxyLoginIMAP{$User}++; ++ $ProxyConnectionIMAP{$Host}++; ++ $ProxyConnection{$Host}++; ++ } ++ } elsif ( ($Reason) = ( $ThisLine =~ /proxy\(.*\): disconnecting .* \(Disconnected (.*)\)/ ) ) { ++ $ProxyDisconnected{$Reason}++; ++ + } elsif ($ThisLine =~ /Disconnected (\[|top)/) { + $Disconnected{"no reason"}++; + } elsif (($Reason) = ($ThisLine =~ /Disconnected: (.*) \[/) ) { +@@ -485,6 +503,49 @@ + } + } + ++if ( ( $Detail >= 5 ) and (keys %ProxyLogin)) { ++ print "\n\nDovecot Proxy IMAP and POP3 Successful Logins:"; ++ $LoginCount = 0; ++ foreach my $User (sort keys %ProxyLogin) { ++ print "\n User $User:"; ++ if ( ($Detail >= 10) and ($ProxyLoginPOP3{$User} > 0 || $ProxyLoginIMAP{$User} > 0) ) { ++ print " ("; ++ if ($ProxyLoginPOP3{$User} > 0) { print "$ProxyLoginPOP3{$User} POP3"; }; ++ if ($ProxyLoginPOP3{$User} > 0 && $ProxyLoginIMAP{$User} > 0) { print "/"; }; ++ if ($ProxyLoginIMAP{$User} > 0) { print "$ProxyLoginIMAP{$User} IMAP"; }; ++ print ")"; ++ } ++ $UserCount = 0; ++ $NumHosts = 0; ++ foreach $Host (sort keys %{$ProxyLogin{$User}}) { ++ $NumHosts++; ++ $HostCount = $ProxyLogin{$User}{$Host}; ++# Cleanly display IPv4 addresses ++ $Host=~ s/::ffff://; ++ print "\n From $Host: $HostCount Time(s)" if ($Detail >= 10); ++ $UserCount += $HostCount; ++ } ++ $LoginCount += $UserCount; ++ if ($Detail >= 10) { ++ if ($NumHosts > 1) { ++ print "\n Total: $UserCount Time(s)\n"; ++ } else { ++ print "\n"; ++ } ++ } elsif ($Detail >= 5) { ++ print " $UserCount Time(s)"; ++ } ++ } ++ print "\nTotal: $LoginCount successful logins"; ++} ++ ++if (keys %ProxyDisconnected) { ++ print "\n\nDovecot Proxy disconnects:\n"; ++ foreach my $Reason (sort keys %ProxyDisconnected) { ++ print " $Reason: $ProxyDisconnected{$Reason} Time(s)\n"; ++ } ++} ++ + if (keys %OtherList) { + print "\n\n**Unmatched Entries**\n"; + foreach $line (sort {$a cmp $b} keys %OtherList) { diff --git a/logwatch.spec b/logwatch.spec index f7ef755..ef75709 100644 --- a/logwatch.spec +++ b/logwatch.spec @@ -1,7 +1,7 @@ Summary: A log file analysis program Name: logwatch Version: 7.4.0 -Release: 10.20120229svn100%{?dist} +Release: 11.20120229svn100%{?dist} License: MIT Group: Applications/System URL: http://www.logwatch.org/ @@ -26,6 +26,7 @@ Patch6: logwatch-smartd.patch Patch7: logwatch-dovecot.patch Patch8: logwatch-sshd.patch Patch10: logwatch-secure-grammar.patch +Patch11: logwatch-dovecot-proxy.patch Requires: textutils sh-utils grep mailx Requires: perl(Date::Manip) BuildArchitectures: noarch @@ -48,6 +49,7 @@ of the package on many systems. %patch7 -p0 %patch8 -p1 %patch10 -p1 +%patch11 -p0 rm -f scripts/services/*.orig %build @@ -139,6 +141,9 @@ echo "# Configuration overrides for specific logfiles/services may be placed her %{_mandir}/man*/* %changelog +* Fri Apr 27 2012 Jan Synáček - 7.4.0-11.20120425svn100 +- Add dovecot-proxy patch (rhbz#812883) + * Wed Apr 25 2012 Jan Synáček - 7.4.0-10.20120425svn100 - Update to revision 100 - Update logwatch-named-dnssec.patch