From 5efb935ac46e65373787cb13d1caeeaa30366278 Mon Sep 17 00:00:00 2001 From: Sven Hoexter Date: Fri, 30 May 2025 08:37:28 +0200 Subject: [PATCH] New upstream version 1.1.10 --- ChangeLog | 10 ++++++++++ pffrombyto.1 | 2 +- pflogsumm | 25 ++++++++++++++++++++----- pflogsumm.1 | 4 ++-- pftobyfrom.1 | 2 +- 5 files changed, 34 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index d554b86..1cc76ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,16 @@ ChangeLog for pflogsumm http://jimsun.LinxNet.com/postfix_contrib.html.] +rel-1.1.10 20250529 + + Bugfix: Messages rejected in latter SMTP processing, after they'd + already been assigned a queue i.d., were incorrectly counted as + received. + + Bugfix: postscreen reject detail processing was inadvertently hobbled + in 1.1.7 as a side-effect of streamlined host/domain/ip-address parsing. + Fixed. + rel-1.1.9 20250527 Bugfix: Messages rejected in cleanup were incorrectly counted diff --git a/pffrombyto.1 b/pffrombyto.1 index efb1f25..eb0e61a 100644 --- a/pffrombyto.1 +++ b/pffrombyto.1 @@ -55,7 +55,7 @@ .\" ======================================================================== .\" .IX Title "PFFROMBYTO 1" -.TH PFFROMBYTO 1 2025-05-22 1.1.9 "User Contributed Perl Documentation" +.TH PFFROMBYTO 1 2025-05-22 1.1.10 "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/pflogsumm b/pflogsumm index 561651b..53c8b6b 100755 --- a/pflogsumm +++ b/pflogsumm @@ -6,7 +6,7 @@ eval 'exec perl -S $0 "$@"' pflogsumm - Produce Postfix MTA logfile summary -Copyright (C) 1998-2025 by James S. Seymour, Release 1.1.9 +Copyright (C) 1998-2025 by James S. Seymour, Release 1.1.10 =head1 SYNOPSIS @@ -411,7 +411,7 @@ eval { require Date::Calc }; my $hasDateCalc = $@ ? 0 : 1; my $mailqCmd = "mailq"; -my $release = "1.1.9"; +my $release = "1.1.10"; # Variables and constants used throughout pflogsumm use vars qw( @@ -742,6 +742,7 @@ while(<>) { proc_smtpd_reject($logRmdr, \%rejects, \$msgsRjctd, \$rejPerHr[$msgHr], \${$msgsPerDay{$revMsgDateStr}}[4]); + delete($rcvdMsg{$qid}) if($rcvdMsg{$qid}); # If it's rejected later in the game } elsif($rejSubTyp eq 'reject_warning') { proc_smtpd_reject($logRmdr, \%warns, \$msgsWrnd, \$rejPerHr[$msgHr], @@ -959,6 +960,16 @@ while(<>) { } } +# Experimental: +# +# If messages were "received" but undelivered, unforwarded, and not +# rejected in cleanup, odds are nothing was ever really received—not +# even a 0-length message. +# +if(my $noSizeCnt = scalar grep { !exists $rcvdMsg{$_}{'size'} } keys %rcvdMsg) { + $msgsRcvd -= $noSizeCnt; +} + # debugging if($unProcd) { close($unProcd) || @@ -1580,10 +1591,14 @@ sub gimme_domain { $_ = $_[0]; my $bracketRegex = '([^\s\[]+)\[((?:\d{1,3}\.){3}\d{1,3}|[\da-fA-F:]+(?:::(?:[\da-fA-F:]+)?)?|[\da-fA-F:]+:(?:\d{1,3}\.){3}\d{1,3})\]'; my $slashSepRegex = '([^\s\/]+)\/((?:\d{1,3}\.){3}\d{1,3}|[\da-fA-F:]+(?:::(?:[\da-fA-F:]+)?)?|[\da-fA-F:]+:(?:\d{1,3}\.){3}\d{1,3})'; + # Rejects and so-on from postscreen pass these in + my $addrOnlyRegex = '^\[((?:\d{1,3}\.){3}\d{1,3}|[\da-fA-F:]+(?:::(?:[\da-fA-F:]+)?)?|[\da-fA-F:]+:(?:\d{1,3}\.){3}\d{1,3})\]'; my ($fqdn, $ipaddr); - unless((($fqdn, $ipaddr) = /$bracketRegex/i) == 2) { - ($fqdn, $ipaddr) = /$slashSepRegex/i; + unless(((($fqdn, $ipaddr) = /$bracketRegex/i) == 2) || + (($fqdn, $ipaddr) = /$slashSepRegex/i) == 2) + { + ($ipaddr) = /$addrOnlyRegex/i; } $fqdn = "unknown" unless($fqdn); $ipaddr = "unknown" unless($ipaddr); @@ -1765,7 +1780,7 @@ sub proc_smtpd_reject { $rejData .= " ($from)" if($opts{'rejAddFrom'}); ++$rejects->{$rejTyp}{$rejReas}{$rejData}; } else { -# print STDERR "dbg: unknown reject reason $rejReas !\n\n"; + #print STDERR "dbg: unknown/un-enumerated reject reason $rejReas, \$rejFrom: \"$rejFrom\"!\n\n"; my $rejData = gimme_domain($rejFrom); if($opts{'rejAddFrom'} && $opts{'rejAddTo'} && $to) { $rejData .= " ($from -> $to)"; diff --git a/pflogsumm.1 b/pflogsumm.1 index 488ce95..98a8bc8 100644 --- a/pflogsumm.1 +++ b/pflogsumm.1 @@ -55,7 +55,7 @@ .\" ======================================================================== .\" .IX Title "PFLOGSUMM 1" -.TH PFLOGSUMM 1 2025-05-27 1.1.9 "User Contributed Perl Documentation" +.TH PFLOGSUMM 1 2025-05-29 1.1.10 "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -63,7 +63,7 @@ .SH NAME pflogsumm \- Produce Postfix MTA logfile summary .PP -Copyright (C) 1998\-2025 by James S. Seymour, Release 1.1.9 +Copyright (C) 1998\-2025 by James S. Seymour, Release 1.1.10 .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 8 diff --git a/pftobyfrom.1 b/pftobyfrom.1 index 4d59013..a62a123 100644 --- a/pftobyfrom.1 +++ b/pftobyfrom.1 @@ -55,7 +55,7 @@ .\" ======================================================================== .\" .IX Title "PFTOBYFROM 1" -.TH PFTOBYFROM 1 2025-05-22 1.1.9 "User Contributed Perl Documentation" +.TH PFTOBYFROM 1 2025-05-22 1.1.10 "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l -- 2.39.5