pflogsumm.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. This patch makes Pflogsumm working with the particular format
  2. of the OSSP fsl based Postfix logfile.
  3. --- pflogsumm.pl.orig Wed Feb 19 23:36:07 2003
  4. +++ pflogsumm.pl Wed Mar 5 10:34:11 2003
  5. @@ -470,7 +470,7 @@
  6. next if(defined($dateStr) && ! /^$dateStr/o);
  7. s/: \[ID \d+\s+[^\]]+\] /: /o; # lose "[ID nnnnnn some.thing]" stuff
  8. unless((($msgMonStr, $msgDay, $msgTimeStr, $cmd, $qid) =
  9. - m#^(...)\s+(\d+)\s(..:..:..)\s\S+\s(?:vmailer|$syslogName)[-/]([^\[:]*).*?: ([^:]+)#o) == 5)
  10. + m#^(...)\s+(\d+)\s(..:..:..)\s\S+\s+\S+\s(?:vmailer|$syslogName)[-/]([^\[:]*).*?: ([^:]+)#o) == 5)
  11. {
  12. unless((($msgMonStr, $msgDay, $msgTimeStr, $cmd, $qid) =
  13. m#^(...)\s+(\d+)\s(..:..:..)\s\S+\s(vmailer|$syslogName[^\[:]*).*?: ([^:]+)#o) == 5)
  14. @@ -581,7 +581,7 @@
  15. @{$connTime{$1}} =
  16. ($msgYr, $msgMon + 1, $msgDay, $msgHr, $msgMin, $msgSec);
  17. } elsif(/: disconnect from /o) {
  18. - my ($pid, $hostID) = /\/smtpd\[(\d+)\]: disconnect from (.+)$/o;
  19. + my ($pid, $hostID) = /\/smtpd\[(\d+)\]: disconnect from (.+)$/o || next;
  20. if(exists($connTime{$pid})) {
  21. $hostID = gimme_domain($hostID);
  22. my($d, $h, $m, $s) = Delta_DHMS(@{$connTime{$pid}},
  23. @@ -1299,7 +1299,7 @@
  24. }
  25. my ($t_mday, $t_mon) = (localtime($time))[3,4];
  26. - return sprintf("%s %2d", $monthNames[$t_mon], $t_mday);
  27. + return sprintf("%s %02d", $monthNames[$t_mon], $t_mday);
  28. }
  29. # if there's a real domain: uses that. Otherwise uses the first