head 1.5; access; symbols OPENPKG_E1_MP_HEAD:1.3 OPENPKG_E1_MP:1.3 OPENPKG_E1_MP_2_STABLE:1.2.14.1 OPENPKG_E1_FP:1.2.14.1 OPENPKG_2_STABLE_MP:1.3 OPENPKG_2_STABLE_20061018:1.2.14.1 OPENPKG_2_STABLE_20060622:1.2 OPENPKG_2_STABLE:1.2.0.14 OPENPKG_2_STABLE_BP:1.2 OPENPKG_2_5_RELEASE:1.2 OPENPKG_2_5_SOLID:1.2.0.12 OPENPKG_2_5_SOLID_BP:1.2 OPENPKG_2_4_RELEASE:1.2 OPENPKG_2_4_SOLID:1.2.0.10 OPENPKG_2_4_SOLID_BP:1.2 OPENPKG_CW_FP:1.2 OPENPKG_2_3_RELEASE:1.2 OPENPKG_2_3_SOLID:1.2.0.8 OPENPKG_2_3_SOLID_BP:1.2 OPENPKG_2_2_RELEASE:1.2 OPENPKG_2_2_SOLID:1.2.0.6 OPENPKG_2_2_SOLID_BP:1.2 OPENPKG_2_1_RELEASE:1.2 OPENPKG_2_1_SOLID:1.2.0.4 OPENPKG_2_1_SOLID_BP:1.2 OPENPKG_2_0_RELEASE:1.2 OPENPKG_2_0_SOLID:1.2.0.2 OPENPKG_2_0_SOLID_BP:1.2 OPENPKG_1_3_RELEASE:1.1.2.1 OPENPKG_1_3_SOLID:1.1.2.1.0.2 OPENPKG_1_3_SOLID_BP:1.1.2.1 OPENPKG_1_STABLE:1.1.0.2 OPENPKG_1_STABLE_MP:1.1; locks; strict; comment @# @; 1.5 date 2008.06.29.17.44.08; author rse; state Exp; branches; next 1.4; commitid nma1J5EJAqJSYR8t; 1.4 date 2007.04.06.15.41.18; author rse; state Exp; branches; next 1.3; commitid MaeDb9wltTSxL1ds; 1.3 date 2006.08.26.07.43.24; author rse; state Exp; branches; next 1.2; commitid zauT5QYXpB61ikKr; 1.2 date 2003.11.28.19.07.28; author ms; state Exp; branches 1.2.14.1; next 1.1; 1.1 date 2003.07.22.14.19.09; author rse; state Exp; branches 1.1.2.1; next ; 1.2.14.1 date 2006.10.16.14.54.56; author rse; state Exp; branches; next ; commitid iZxwRSmmWscPXUQr; 1.1.2.1 date 2003.07.24.20.45.04; author rse; state Exp; branches; next ; desc @@ 1.5 log @modifying package: postfix-2.5.2 20080509 -> 20080629 @ text @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 Index: pflogsumm.pl --- pflogsumm.pl.orig 2008-06-29 15:46:01 +0200 +++ pflogsumm.pl 2008-06-29 19:39:07 +0200 @@@@ -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 @@@@ -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" + (Actually this will take any date string + parsable by the perl Date::Parse module) -e extended (extreme? excessive?) detail @@@@ -359,6 +362,7 @@@@ use strict; use locale; use Getopt::Long; +use Date::Parse; 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 || - (($cmd, $qid) = $logRmdr =~ m#^((?:postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) + unless((($cmd, $qid) = $logRmdr =~ m#^<[a-z]+>\s+(?:postfix|$syslogName)/([^\[:]*).*?: ([^:\s]+)#o) == 2 || + (($cmd, $qid) = $logRmdr =~ m#^<[a-z]+>\s+((?:postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) { #print UNPROCD "$_"; next; @@@@ -1406,11 +1410,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]; - return sprintf("%s %2d", $monthNames[$t_mon], $t_mday); + return sprintf("%s %02d", $monthNames[$t_mon], $t_mday); } # if there's a real domain: uses that. Otherwise uses the IP addr. @ 1.4 log @modifying package: postfix-2.4.0 20070329 -> 20070406 @ text @d18 2 a19 2 --- pflogsumm.pl.orig 2007-04-06 16:06:37 +0200 +++ pflogsumm.pl 2007-04-06 17:37:09 +0200 d58 3 a60 3 @@@@ -1394,11 +1398,11 @@@@ if($dateOpt eq "yesterday") { $time -= $aDay; @ 1.3 log @allow pflogsumm to accept a more flexible data format @ text @d6 3 a8 3 --- pflogsumm.1.orig 2003-12-12 15:41:55 +0100 +++ pflogsumm.1 2006-08-26 09:36:50 +0200 @@@@ -225,6 +225,8 @@@@ d15 1 a16 1 \& -e extended (extreme? excessive?) detail d18 2 a19 2 --- pflogsumm.pl.orig 2003-12-12 15:40:19 +0100 +++ pflogsumm.pl 2006-08-26 09:37:43 +0200 d39 4 a42 4 @@@@ -361,6 +364,7 @@@@ # ---Begin: SMTPD_STATS_SUPPORT--- use Date::Calc qw(Delta_DHMS); # ---End: SMTPD_STATS_SUPPORT--- d44 2 d47 1 a47 3 my $mailqCmd = "mailq"; my $release = "1.1.0"; @@@@ -516,8 +520,8 @@@@ d51 4 a54 4 - unless((($cmd, $qid) = $logRmdr =~ m#^(?:vmailer|postfix|$syslogName)/([^\[:]*).*?: ([^:\s]+)#o) == 2 || - (($cmd, $qid) = $logRmdr =~ m#^((?:vmailer|postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) + unless((($cmd, $qid) = $logRmdr =~ m#^<[a-z]+>\s+(?:vmailer|postfix|$syslogName)/([^\[:]*).*?: ([^:\s]+)#o) == 2 || + (($cmd, $qid) = $logRmdr =~ m#^<[a-z]+>\s+((?:vmailer|postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) d58 1 a58 1 @@@@ -1374,11 +1378,11 @@@@ @ 1.2 log @modifying package: postfix-2.0.16 20031128 again @ text @d2 2 a3 1 of the OSSP fsl based Postfix logfile. d5 43 a47 3 --- pflogsumm.pl.orig 2003-11-28 20:01:19.000000000 +0100 +++ pflogsumm.pl 2003-11-28 20:02:28.000000000 +0100 @@@@ -516,8 +516,8 @@@@ d58 6 a63 1 @@@@ -1378,7 +1378,7 @@@@ @ 1.2.14.1 log @Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class) @ text @d2 1 a2 2 of the OSSP fsl based Postfix logfile and additionally allows one to specify a more flexible data format. d4 3 a6 43 Index: pflogsumm.1 --- pflogsumm.1.orig 2003-12-12 15:41:55 +0100 +++ pflogsumm.1 2006-08-26 09:36:50 +0200 @@@@ -225,6 +225,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 .Vb 1 \& -e extended (extreme? excessive?) detail Index: pflogsumm.pl --- pflogsumm.pl.orig 2003-12-12 15:40:19 +0100 +++ pflogsumm.pl 2006-08-26 09:37:43 +0200 @@@@ -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 @@@@ -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" + (Actually this will take any date string + parsable by the perl Date::Parse module) -e extended (extreme? excessive?) detail @@@@ -361,6 +364,7 @@@@ # ---Begin: SMTPD_STATS_SUPPORT--- use Date::Calc qw(Delta_DHMS); # ---End: SMTPD_STATS_SUPPORT--- +use Date::Parse; my $mailqCmd = "mailq"; my $release = "1.1.0"; @@@@ -516,8 +520,8 @@@@ d17 1 a17 6 @@@@ -1374,11 +1378,11 @@@@ if($dateOpt eq "yesterday") { $time -= $aDay; } elsif($dateOpt ne "today") { - die "$usageMsg\n"; + $time = str2time($dateOpt); @ 1.1 log @cleanup packaging @ text @d4 3 a6 5 --- pflogsumm.pl.orig Tue Jun 17 17:59:57 2003 +++ pflogsumm.pl Tue Jun 24 11:41:59 2003 @@@@ -498,8 +498,8 @@@@ s/: \[ID \d+\s+[^\]]+\] /: /o; # lose "[ID nnnnnn some.thing]" stuff d8 2 a9 1 ($msgMonStr, $msgDay, $msgTimeStr, $logRmdr) = /^(...)\s+(\d+)\s(..:..:..)\s\S+\s(.+)$/o; d17 1 a17 1 @@@@ -1324,7 +1324,7 @@@@ d25 1 a25 1 # if there's a real domain: uses that. Otherwise uses the first @ 1.1.2.1 log @mass Merge-From-CURRENT (MFC) in preparation for OpenPKG 1.3 [class BASE only] @ text @@