diff -r fd1de0c7bc20 -r 01294b31a79e postfix/postfix.patch.pfls --- a/postfix/postfix.patch.pfls Wed Aug 08 20:36:32 2012 +0200 +++ b/postfix/postfix.patch.pfls Thu Aug 09 00:41:14 2012 +0200 @@ -1,32 +1,28 @@ -This patch makes Pflogsumm working with the particular format -of the OSSP fsl based Postfix logfile and additionally allows -one to specify a more flexible data format. - Index: pflogsumm.1 ---- pflogsumm.1.orig 2007-04-06 16:11:28 +0200 -+++ pflogsumm.1 2007-04-06 17:35:12 +0200 -@@ -172,6 +172,8 @@ - .Vb 2 - \& -d today generate report for just today - \& -d yesterday generate report for just "yesterday" -+\& -d YYYY-MM-DD generate report for just "YYYY-MM-DD" -+\& (Really takes string Date::Parse will handle) - .Ve - .PP - .Vb 1 +--- pflogsumm.1.orig 2012-02-05 23:34:29.000000000 +0100 ++++ pflogsumm.1 2012-02-06 08:49:47.000000000 +0100 +@@ -171,6 +171,8 @@ + \& + \& \-d today generate report for just today + \& \-d yesterday generate report for just "yesterday" ++\& \-d YYYY-MM-DD generate report for just "YYYY-MM-DD" ++\& (Really takes string Date::Parse will handle) + \& + \& \-\-deferral\-detail + \& Index: pflogsumm.pl ---- pflogsumm.pl.orig 2008-06-29 15:46:01 +0200 -+++ pflogsumm.pl 2008-06-29 19:39:07 +0200 +--- pflogsumm.pl.orig 2012-02-05 23:25:25.000000000 +0100 ++++ pflogsumm.pl 2012-02-06 20:53:39.000000000 +0100 @@ -10,7 +10,7 @@ =head1 SYNOPSIS -- pflogsumm.pl -[eq] [-d ] [-h ] [-u ] -+ pflogsumm.pl -[eq] [-d ] [-h ] [-u ] - [--verp_mung[=]] [--verbose_msg_detail] [--iso_date_time] - [-m|--uucp_mung] [-i|--ignore_case] [--smtpd_stats] [--mailq] - [--problems_first] [--rej_add_from] [--no_bounce_detail] -@@ -37,6 +37,9 @@ +- pflogsumm.pl -[eq] [-d ] [--detail ] ++ pflogsumm.pl -[eq] [-d ] [--detail ] + [--bounce-detail ] [--deferral-detail ] + [-h ] [-i|--ignore-case] [--iso-date-time] [--mailq] + [-m|--uucp-mung] [--no-no-msg-size] [--problems-first] +@@ -43,6 +43,9 @@ -d today generate report for just today -d yesterday generate report for just "yesterday" @@ -34,9 +30,9 @@ + (Actually this will take any date string + parsable by the perl Date::Parse module) - -e extended (extreme? excessive?) detail + --deferral-detail -@@ -359,6 +362,7 @@ +@@ -398,6 +401,7 @@ use strict; use locale; use Getopt::Long; @@ -44,28 +40,28 @@ eval { require Date::Calc }; my $hasDateCalc = $@ ? 0 : 1; -@@ -542,8 +546,8 @@ - my $logRmdr; - next unless((($msgMonStr, $msgDay, $msgHr, $msgMin, $msgSec, $logRmdr) = - /^(...) +(\d+) (..):(..):(..) \S+ (.+)$/o) == 6); -- unless((($cmd, $qid) = $logRmdr =~ m#^(?:postfix|$syslogName)/([^\[:]*).*?: ([^:\s]+)#o) == 2 || +@@ -639,8 +643,8 @@ + --$msgMon; + } + +- unless((($cmd, $qid) = $logRmdr =~ m#^(?:postfix|$syslogName)(?:/(?:smtps|submission))?/([^\[:]*).*?: ([^:\s]+)#o) == 2 || - (($cmd, $qid) = $logRmdr =~ m#^((?:postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) -+ unless((($cmd, $qid) = $logRmdr =~ m#^<[a-z]+>\s+(?:postfix|$syslogName)/([^\[:]*).*?: ([^:\s]+)#o) == 2 || ++ unless((($cmd, $qid) = $logRmdr =~ m#^<[a-z]+>\s+(?:postfix|$syslogName)(?:/(?:smtps|submission))?/([^\[:]*).*?: ([^:\s]+)#o) == 2 || + (($cmd, $qid) = $logRmdr =~ m#^<[a-z]+>\s+((?:postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) { #print UNPROCD "$_"; next; -@@ -1406,11 +1410,11 @@ +@@ -1514,11 +1518,11 @@ # Back up to yesterday $time -= ((localtime($time))[2] + 2) * 3600; } elsif($dateOpt ne "today") { - die "$usageMsg\n"; + $time = str2time($dateOpt); } - my ($t_mday, $t_mon) = (localtime($time))[3,4]; + my ($t_mday, $t_mon, $t_year) = (localtime($time))[3,4,5]; -- return sprintf("%s %2d", $monthNames[$t_mon], $t_mday); -+ return sprintf("%s %02d", $monthNames[$t_mon], $t_mday); +- return sprintf("%s %2d", $monthNames[$t_mon], $t_mday), sprintf("%04d-%02d-%02d", $t_year+1900, $t_mon+1, $t_mday); ++ return sprintf("%s %02d", $monthNames[$t_mon], $t_mday), sprintf("%04d-%02d-%02d", $t_year+1900, $t_mon+1, $t_mday); } # if there's a real domain: uses that. Otherwise uses the IP addr.