]> git.sven.stormbind.net Git - sven/pflogsumm.git/blob - debian/patches/postscreen-rejects
releasing package pflogsumm version 1.1.5-8
[sven/pflogsumm.git] / debian / patches / postscreen-rejects
1 Index: pflogsumm/pflogsumm.pl
2 ===================================================================
3 --- pflogsumm.orig/pflogsumm.pl
4 +++ pflogsumm/pflogsumm.pl
5 @@ -713,7 +713,7 @@ while(<>) {
6                           \${$msgsPerDay{$revMsgDateStr}}[4]);
7      } elsif($cmd eq 'master') {
8         ++$masterMsgs{(split(/^.*master.*: /, $logRmdr))[1]};
9 -    } elsif($cmd eq 'smtpd') {
10 +    } elsif($cmd eq 'smtpd' || $cmd eq 'postscreen') {
11         if($logRmdr =~ /\[\d+\]: \w+: client=(.+?)(,|$)/) {
12             #
13             # Warning: this code in two places!
14 @@ -1536,14 +1536,14 @@ sub gimme_domain {
15      # split domain/ipaddr into separates
16      # newer versions of Postfix have them "dom.ain[i.p.add.ress]"
17      # older versions of Postfix have them "dom.ain/i.p.add.ress"
18 -    unless((($domain, $ipAddr) = /^([^\[]+)\[((?:\d{1,3}\.){3}\d{1,3})\]/) == 2 ||
19 -           (($domain, $ipAddr) = /^([^\/]+)\/([0-9a-f.:]+)/i) == 2) {
20 +    unless((($domain, $ipAddr) = /^([^\[]*)\[((?:\d{1,3}\.){3}\d{1,3})\]/) == 2||
21 +           (($domain, $ipAddr) = /^([^\/]*)\/([0-9a-f.:]+)/i) == 2) {
22         # more exhaustive method
23 -        ($domain, $ipAddr) = /^([^\[\(\/]+)[\[\(\/]([^\]\)]+)[\]\)]?:?\s*$/;
24 +        ($domain, $ipAddr) = /^([^\[\(\/]*)[\[\(\/]([^\]\)]+)[\]\)]:?\d*$/;
25      }
26   
27      # "mach.host.dom"/"mach.host.do.co" to "host.dom"/"host.do.co"
28 -    if($domain eq 'unknown') {
29 +    if($domain eq "" || $domain eq 'unknown') {
30          $domain = $ipAddr;
31         # For identifying the host part on a Class C network (commonly
32         # seen with dial-ups) the following is handy.
33 @@ -1656,9 +1656,10 @@ sub proc_smtpd_reject {
34             # those--incl. stuff that'll screw up subsequent parsing.  So just
35             # get rid of it right off.
36             $rejReas =~ s/^(\d{3} <).*?(>:)/$1$2/;
37 +           $rejReas =~ s/^(?:\d{3} \d\.\d\.\d )(Protocol error);.*$/$1/;
38             $rejReas =~ s/^(?:.*?[:;] )(?:\[[^\]]+\] )?([^;,]+)[;,].*$/$1/;
39             $rejReas =~ s/^((?:Sender|Recipient) address rejected: [^:]+):.*$/$1/;
40 -           $rejReas =~ s/(Client host|Sender address) .+? blocked/blocked/;
41 +           $rejReas =~ s/(client|Client host|Sender address) .+? blocked/blocked/;
42         } elsif($rejTyp eq "MAIL") {    # *more* special treatment :-( grrrr...
43             $rejReas =~ s/^\d{3} (?:<.+>: )?([^;:]+)[;:]?.*$/$1/;
44         } else {