Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > 8ff15aaec6aa7c6a6bfade293a2cfbaa > files > 22

logwatch-7.3.6-55.fc13.src.rpm

--- logwatch/scripts/services/dovecot	2009-08-11 21:59:52.000000000 +1000
+++ dovecot	2010-01-16 16:08:55.000000000 +1100
@@ -82,6 +82,8 @@
          $ConnectionIMAP{$Host}++;
          $Connection{$Host}++; 
       }
+    } elsif ( ($User, $Mailbox) = ( $ThisLine =~ /^dovecot: deliver\((.*)\): msgid=.*: saved mail to (\S+)/ ) ) {
+      $Deliver{$User}{$Mailbox}++;
 
 # This is for Dovecot 1.0 series
     } elsif ( ($User, $Host) = ( $ThisLine =~ /^dovecot: pop3-login: Login: user=\<(.*?)\>.*rip=(.*)\, lip=/ ) ) {
@@ -198,6 +200,27 @@
                  " |" . " " x $totalSpaceLength . $TotalCount . "\n";
 }
 
+if ( ( $Detail >= 10 ) and (keys %Deliver)) {
+   print "\n\nDovecot Deliveries:";
+   $DeliverCount = 0;
+   foreach my $User (keys %Deliver) {
+      print "\n\n  User $User:";
+      $UserCount = 0;
+      $NumMailboxes = 0;
+      foreach $Mailbox (keys %{$Deliver{$User}}) {
+         $NumMailboxes++;
+         $MailboxCount = $Deliver{$User}{$Mailbox};
+         print "\n    To $Mailbox: $MailboxCount Time(s)";
+         $UserCount += $MailboxCount;
+      }
+      $DeliverCount += $UserCount;
+      if ($NumMailboxes > 1) {
+      print "\n  Total: $UserCount Time(s)";
+      }
+   }
+   print "\n\nTotal: $DeliverCount successful deliveries";
+}
+
 if ( ( $Detail >= 10 ) and (keys %Login)) {
    print "\n\nDovecot IMAP and POP3 Successful Logins:";
    $LoginCount = 0;