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 <today|yesterday>] [-h <cnt>] [-u <cnt>]
+    pflogsumm.pl -[eq] [-d <today|yesterday|YYYY-MM-DD>] [-h <cnt>] [-u <cnt>]
 	[--verp_mung[=<n>]] [--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.
