1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/postfix/postfix.patch.pfls Mon Apr 06 23:53:05 2009 +0200 1.3 @@ -0,0 +1,71 @@ 1.4 +This patch makes Pflogsumm working with the particular format 1.5 +of the OSSP fsl based Postfix logfile and additionally allows 1.6 +one to specify a more flexible data format. 1.7 + 1.8 +Index: pflogsumm.1 1.9 +--- pflogsumm.1.orig 2007-04-06 16:11:28 +0200 1.10 ++++ pflogsumm.1 2007-04-06 17:35:12 +0200 1.11 +@@ -172,6 +172,8 @@ 1.12 + .Vb 2 1.13 + \& -d today generate report for just today 1.14 + \& -d yesterday generate report for just "yesterday" 1.15 ++\& -d YYYY-MM-DD generate report for just "YYYY-MM-DD" 1.16 ++\& (Really takes string Date::Parse will handle) 1.17 + .Ve 1.18 + .PP 1.19 + .Vb 1 1.20 +Index: pflogsumm.pl 1.21 +--- pflogsumm.pl.orig 2008-06-29 15:46:01 +0200 1.22 ++++ pflogsumm.pl 2008-06-29 19:39:07 +0200 1.23 +@@ -10,7 +10,7 @@ 1.24 + 1.25 + =head1 SYNOPSIS 1.26 + 1.27 +- pflogsumm.pl -[eq] [-d <today|yesterday>] [-h <cnt>] [-u <cnt>] 1.28 ++ pflogsumm.pl -[eq] [-d <today|yesterday|YYYY-MM-DD>] [-h <cnt>] [-u <cnt>] 1.29 + [--verp_mung[=<n>]] [--verbose_msg_detail] [--iso_date_time] 1.30 + [-m|--uucp_mung] [-i|--ignore_case] [--smtpd_stats] [--mailq] 1.31 + [--problems_first] [--rej_add_from] [--no_bounce_detail] 1.32 +@@ -37,6 +37,9 @@ 1.33 + 1.34 + -d today generate report for just today 1.35 + -d yesterday generate report for just "yesterday" 1.36 ++ -d YYYY-MM-DD generate report for just "YYYY-MM-DD" 1.37 ++ (Actually this will take any date string 1.38 ++ parsable by the perl Date::Parse module) 1.39 + 1.40 + -e extended (extreme? excessive?) detail 1.41 + 1.42 +@@ -359,6 +362,7 @@ 1.43 + use strict; 1.44 + use locale; 1.45 + use Getopt::Long; 1.46 ++use Date::Parse; 1.47 + eval { require Date::Calc }; 1.48 + my $hasDateCalc = $@ ? 0 : 1; 1.49 + 1.50 +@@ -542,8 +546,8 @@ 1.51 + my $logRmdr; 1.52 + next unless((($msgMonStr, $msgDay, $msgHr, $msgMin, $msgSec, $logRmdr) = 1.53 + /^(...) +(\d+) (..):(..):(..) \S+ (.+)$/o) == 6); 1.54 +- unless((($cmd, $qid) = $logRmdr =~ m#^(?:postfix|$syslogName)/([^\[:]*).*?: ([^:\s]+)#o) == 2 || 1.55 +- (($cmd, $qid) = $logRmdr =~ m#^((?:postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) 1.56 ++ unless((($cmd, $qid) = $logRmdr =~ m#^<[a-z]+>\s+(?:postfix|$syslogName)/([^\[:]*).*?: ([^:\s]+)#o) == 2 || 1.57 ++ (($cmd, $qid) = $logRmdr =~ m#^<[a-z]+>\s+((?:postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) 1.58 + { 1.59 + #print UNPROCD "$_"; 1.60 + next; 1.61 +@@ -1406,11 +1410,11 @@ 1.62 + # Back up to yesterday 1.63 + $time -= ((localtime($time))[2] + 2) * 3600; 1.64 + } elsif($dateOpt ne "today") { 1.65 +- die "$usageMsg\n"; 1.66 ++ $time = str2time($dateOpt); 1.67 + } 1.68 + my ($t_mday, $t_mon) = (localtime($time))[3,4]; 1.69 + 1.70 +- return sprintf("%s %2d", $monthNames[$t_mon], $t_mday); 1.71 ++ return sprintf("%s %02d", $monthNames[$t_mon], $t_mday); 1.72 + } 1.73 + 1.74 + # if there's a real domain: uses that. Otherwise uses the IP addr.