X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=postfix-logwatch;h=648ba7add6256222643e2d43368cde7a87101b94;hb=7b3930a9d44f91a63f0edbe765c75dc8f6128b7c;hp=1e58a95c3366908284c2012b2d15ffaa6ae36f95;hpb=84f9fb47783e63757f27e5990ee606ff01e079a9;p=postfix-logwatch.git diff --git a/postfix-logwatch b/postfix-logwatch index 1e58a95..648ba7a 100644 --- a/postfix-logwatch +++ b/postfix-logwatch @@ -66,7 +66,9 @@ my $re_QID_s = qr/[A-Z\d]+/; my $re_QID_l = qr/(?:NOQUEUE|[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ\d]+)/; our $re_QID; -our $re_DSN = qr/(?:(?:\d{3})?(?: ?\d\.\d\.\d)?)/; +# The enhanced status codes can contain two-digit (or more) numbers; +# for example, "550 5.7.23". +our $re_DSN = qr/(?:(?:\d{3})?(?: ?\d+\.\d+\.\d+)?)/; our $re_DDD = qr/(?:(?:conn_use=\d+ )?delay=-?[\d.]+(?:, delays=[\d\/.]+)?(?:, dsn=[\d.]+)?)/; #MODULE: ../Logreporters/Utils.pm @@ -1378,8 +1380,17 @@ sub print_summary_report (\@) { $$divisor == $Totals{$keyname} ? 100.00 : $Totals{$keyname} * 100 / $$divisor; } else { - push @{$lines[$cur_level]}, - sprintf "$fmt %-23s $extra\n", $total, $desc, commify ($Totals{$keyname}); + my $new_line; + if ($extra eq '') { + $new_line = sprintf("$fmt %-23s \n", $total, $desc); + } + else { + $new_line = sprintf("$fmt %-23s $extra\n", + $total, + $desc, + commify ($Totals{$keyname})); + } + push @{$lines[$cur_level]}, $new_line } } } @@ -4388,14 +4399,11 @@ sub postfix_postscreen { } } - elsif ($line =~ /^NOQUEUE: reject: CONNECT from \[([^]]+)\](?::\d+)?: too many connections/) { - # NOQUEUE: reject: CONNECT from [192.168.0.1]:7197: too many connections - $Counts{'postscreen'}{'reject'}{'Too many connections'}{$1}{$END_KEY}++ if $Collecting{'postscreen'}; - } - - elsif ($line =~ /^reject: connect from \[([^]]+)\](?::\d+)?: (.+)$/) { - # reject: connect from [192.168.0.1]:21225: all screening ports busy - $Counts{'postscreen'}{'reject'}{"\u$2"}{$1}{$END_KEY}++ if $Collecting{'postscreen'}; + elsif ($line =~ /^(NOQUEUE: )?reject: (connect|CONNECT) from \[([^]]+)\](?::\d+)?: (.+)$/) { + # NOQUEUE: reject: CONNECT from [192.168.0.1]:7197: too many connections + # NOQUEUE: reject: CONNECT from [192.168.0.1]:39410: all server ports busy + # reject: connect from [192.168.0.1]:21225: all screening ports busy + $Counts{'postscreen'}{'reject'}{"\u$4"}{$3}{$END_KEY}++ if $Collecting{'postscreen'}; } elsif ($line =~ /^(?:WHITELIST VETO) \[([^]]+)\](?::\d+)?$/) {