--- /usr/local/bin/pflogsumm Sat Aug 4 11:51:37 2007 +++ /usr/local/bin/pflogsumm2 Sun Nov 11 02:23:29 2007 @@ -363,7 +363,7 @@ my $hasDateCalc = $@ ? 0 : 1; my $mailqCmd = "mailq"; -my $release = "1.1.1"; +my $release = "1.1.1mod"; # Variables and constants used throughout pflogsumm use vars qw( @@ -1426,7 +1426,7 @@ $domain = $ipAddr; # For identifying the host part on a Class C network (commonly # seen with dial-ups) the following is handy. - # $domain =~ s/\.\d+$//o; + $domain =~ s/\.\d+$//o; } else { $domain =~ s/^(.*)\.([^\.]+)\.([^\.]{3}|[^\.]{2,3}\.[^\.]{2})$/\L$2.$3/o; @@ -1566,15 +1566,22 @@ # Sender address rejected: need fully-qualified address ++$rejects->{$rejTyp}{$rejReas}{$from}; } elsif($rejReas =~ m/^(Recipient address rejected:|User unknown( |$))/o) { - # Recipient address rejected: Domain not found - # Recipient address rejected: need fully-qualified address - # User unknown (in local/relay recipient table) - #++$rejects->{$rejTyp}{$rejReas}{$to}; - my $rejData = $to; - if($rejAddFrom) { - $rejData .= " (" . ($from? $from : gimme_domain($rejFrom)) . ")"; + my $rejData; + # special case for policyd-weight/postgrey + if ($rejReas =~ m/^Recipient address rejected: (Greylisted|Your MTA is listed in too many DNSBLs|Mail appeared to be SPAM or forged|temporarily blocked because of previous errors|No DNS entries for your MTA)/o) { + $rejData = gimme_domain($rejFrom); + } + else { + # Recipient address rejected: Domain not found + # Recipient address rejected: need fully-qualified address + # User unknown (in local/relay recipient table) + #++$rejects->{$rejTyp}{$rejReas}{$to}; + $rejData = $to; + if($rejAddFrom) { + $rejData .= " (" . ($from? $from : gimme_domain($rejFrom)) . ")"; + } } - ++$rejects->{$rejTyp}{$rejReas}{$rejData}; + ++$rejects->{$rejTyp}{$rejReas}{$rejData}; } elsif($rejReas =~ s/^.*?\d{3} (Improper use of SMTP command pipelining);.*$/$1/o) { # Was an IPv6 problem here my ($src) = $logLine =~ /^.+? from (\S+?):.*$/o;