Guest User

rhel/centos5 plesk logwatch fix - imapd file

a guest
Apr 2nd, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.15 KB | None | 0 0
  1. --- imapd~      2012-03-27 05:42:52.000000000 +0300
  2. +++ imapd       2012-03-31 10:46:17.000000000 +0300
  3. @@ -38,18 +38,19 @@
  4.     if (
  5.        ($ThisLine =~ /^Initializing */) or
  6.        ($ThisLine =~ /^spgetpwnam: can't find user: */) or
  7. -      ($ThisLine =~ /^couriertls: read: Connection reset by peer/ )
  8. +      ($ThisLine =~ /^couriertls: read: Connection reset by peer/) or
  9. +      ($ThisLine =~ /digascii: [a-f0-9]*, response: /)
  10.     ) {
  11.        # Don't care about these...
  12.     } elsif ( ($User, $Host) = ( $ThisLine =~ /^Login user=(.*?) host=(.*\[.*\])$/ ) ) {
  13.        $Login{$User}{$Host}++;
  14. -   } elsif ( ($User, $Host) = ( $ThisLine =~ /^LOGIN, user=(.*?), ip=\[(.*)\], protocol=IMAP$/o ) ) {
  15. +   } elsif ( ($User, $Host) = ( $ThisLine =~ /LOGIN, user=(.*?), ip=\[(.*)\], protocol=IMAP$/o ) ) {
  16.        $Login{$User}{$Host}++;
  17.     } elsif ( ($User,$Host) = ( $ThisLine =~ /^Authenticated user=(.*) host=(.*\[.*\])$/ ) ) {
  18.        $Login{$User}{$Host}++;
  19.     } elsif ( ($User,$Host) = ( $ThisLine =~ /^Preauthenticated user=(.*) host=(.*)$/ ) ) {
  20.        $Login{$User}{$Host}++;
  21. -   } elsif ( ($Host) = ( $ThisLine =~ /^imap service init from (.*)$/ ) ) {
  22. +   } elsif ( ($Host) = ( $ThisLine =~ /^IMAP connect from @ \[(.*)\]/ ) ) {
  23.        $ConnectionNonSSL{$Host}++;
  24.        $Connection{$Host}++;
  25.     } elsif ( ($Host) = ( $ThisLine =~ /^imaps SSL service init from (.*)$/ ) ) {
  26. @@ -67,7 +68,12 @@
  27.     } elsif ( ($User, $Host) = ( $ThisLine =~ /^Logout user=(.*?) host=(.*\[.*\])$/) ) {
  28.        $Logout{$User}{$Host}++;
  29.        $Logout2{$User}++;
  30. -   } elsif ( ($dummy, $User, $Host, $DownloadSize1, $DownloadSize2) = ( $ThisLine =~ /^(LOGOUT|TIMEOUT|DISCONNECTED), user=(.*?), ip=\[(.*)\], headers=(\d+), body=(\d+)/o ) ) {
  31. +   } elsif ( ($dummy, $User, $Host, $DownloadSize1, $DownloadSize2) = ( $ThisLine =~ /(LOGOUT|TIMEOUT|DISCONNECTED), (user=.*, )?ip=\[(.*)\], headers=(\d+), body=(\d+)/o ) ) {
  32. +      if ( ($dummy) = ( $User =~ /user=(.*)/ ) ) {
  33. +         $User = $dummy;
  34. +      } else {
  35. +         $User = "unknown";
  36. +      }
  37.        $Logout{$User}{$Host}++;
  38.        $Logout2{$User}++;
  39.        $DownloadedMessagesSize{$User} += $DownloadSize1 + $DownloadSize2;
Add Comment
Please, Sign In to add comment