X-Git-Url: http://git.sven.stormbind.net/?p=sven%2Fpflogsumm.git;a=blobdiff_plain;f=debian%2Fpatches%2Fpostscreen-rejects;fp=debian%2Fpatches%2Fpostscreen-rejects;h=aedb249d22c2b96f6a6b49fe3b67bf6fed3829c3;hp=0000000000000000000000000000000000000000;hb=7e846149c4eed7bead8214199eebc637a66b6333;hpb=94df9c8b8abc10089b1a9f6c566f026eb68689a4 diff --git a/debian/patches/postscreen-rejects b/debian/patches/postscreen-rejects new file mode 100644 index 0000000..aedb249 --- /dev/null +++ b/debian/patches/postscreen-rejects @@ -0,0 +1,43 @@ +Index: pflogsumm.pl +=================================================================== +--- pflogsumm.pl.orig ++++ pflogsumm.pl +@@ -713,7 +713,7 @@ while(<>) { + \${$msgsPerDay{$revMsgDateStr}}[4]); + } elsif($cmd eq 'master') { + ++$masterMsgs{(split(/^.*master.*: /, $logRmdr))[1]}; +- } elsif($cmd eq 'smtpd') { ++ } elsif($cmd eq 'smtpd' || $cmd eq 'postscreen') { + if($logRmdr =~ /\[\d+\]: \w+: client=(.+?)(,|$)/) { + # + # Warning: this code in two places! +@@ -1536,14 +1536,14 @@ sub gimme_domain { + # split domain/ipaddr into separates + # newer versions of Postfix have them "dom.ain[i.p.add.ress]" + # older versions of Postfix have them "dom.ain/i.p.add.ress" +- unless((($domain, $ipAddr) = /^([^\[]+)\[((?:\d{1,3}\.){3}\d{1,3})\]/) == 2 || +- (($domain, $ipAddr) = /^([^\/]+)\/([0-9a-f.:]+)/i) == 2) { ++ unless((($domain, $ipAddr) = /^([^\[]*)\[((?:\d{1,3}\.){3}\d{1,3})\]/) == 2|| ++ (($domain, $ipAddr) = /^([^\/]*)\/([0-9a-f.:]+)/i) == 2) { + # more exhaustive method + ($domain, $ipAddr) = /^([^\[\(\/]+)[\[\(\/]([^\]\)]+)[\]\)]?:?\s*$/; + } + + # "mach.host.dom"/"mach.host.do.co" to "host.dom"/"host.do.co" +- if($domain eq 'unknown') { ++ if($domain eq "" || $domain eq 'unknown') { + $domain = $ipAddr; + # For identifying the host part on a Class C network (commonly + # seen with dial-ups) the following is handy. +@@ -1656,9 +1656,10 @@ sub proc_smtpd_reject { + # those--incl. stuff that'll screw up subsequent parsing. So just + # get rid of it right off. + $rejReas =~ s/^(\d{3} <).*?(>:)/$1$2/; ++ $rejReas =~ s/^(?:\d{3} \d\.\d\.\d )(Protocol error);.*$/$1/; + $rejReas =~ s/^(?:.*?[:;] )(?:\[[^\]]+\] )?([^;,]+)[;,].*$/$1/; + $rejReas =~ s/^((?:Sender|Recipient) address rejected: [^:]+):.*$/$1/; +- $rejReas =~ s/(Client host|Sender address) .+? blocked/blocked/; ++ $rejReas =~ s/(client|Client host|Sender address) .+? blocked/blocked/; + } elsif($rejTyp eq "MAIL") { # *more* special treatment :-( grrrr... + $rejReas =~ s/^\d{3} (?:<.+>: )?([^;:]+)[;:]?.*$/$1/; + } else {