From 02a5370b44c1f032e5a7ec1618a9924fe1c903b3 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 15 May 2026 14:33:12 -0400 Subject: [PATCH] postfix-logwatch: match postfix-3.11 tls= field In postfix-3.11, a new tls= field appears between the "delays" and "dsn" fields on a sent-message line: https://www.postfix.org/announcements/postfix-3.11.0.html The format is decribed under, https://www.postfix.org/postconf.5.html#smtp_log_tls_feature_status We add the new field to $re_DDD, which is now a minor misnomer. This is the only thing (so far...) needed to support postfix-3.11.2. --- postfix-logwatch | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/postfix-logwatch b/postfix-logwatch index 30cae44..3e9bba1 100755 --- a/postfix-logwatch +++ b/postfix-logwatch @@ -45,9 +45,11 @@ my $re_QID_l = qr/(?:NOQUEUE|[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ\d]+)/ our $re_QID; # The enhanced status codes can contain two-digit (or more) numbers; -# for example, "550 5.7.23". +# for example, "550 5.7.23". In postfix-3.11 and later, a new +# tls= field appears between "delays" and "dsn". The format is +# described under smtp_log_tls_feature_status in postconf(5) man page. our $re_DSN = qr/(?:(?:\d{3})?(?: ?\d+\.\d+\.\d+)?)/; -our $re_DDD = qr/(?:(?:conn_use=\d+ )?delay=-?[\d.]+(?:, delays=[\d\/.]+)?(?:, dsn=[\d.]+)?)/; +our $re_DDD = qr/(?:(?:conn_use=\d+ )?delay=-?[\d.]+(?:, delays=[\d\/.]+)?(?:, tls=[a-z:!\/\?]+)?(?:, dsn=[\d.]+)?)/; #MODULE: ../Logreporters/Utils.pm package Logreporters::Utils; @@ -3291,6 +3293,10 @@ sys 0m3.005s #TD 552B6C20E: to=, relay=mail.example.net[10.0.0.1]:25, delay=1021, delays=1020/0.04/0.56/0.78, dsn=2.0.0, status=sent (250 Ok: queued as 6EAC4719EB) #TD 552B6C20E: to=, relay=mail.example.net[10.0.0.1]:25, conn_use=2 delay=1021, delays=1020/0.04/0.56/0.78, dsn=2.0.0, status=sent (250 Ok: queued as 6EAC4719EB) #TD DD925BBE2: to=, orig_to=, relay=mail.example.net[2001:dead:beef::1], delay=2, status=sent (250 Ok: queued as 5221227246) + # In postfix-3.11 and later, a new tls= field is present: + # + #TD 4gGzkS37gTz3xBY: to=, orig_to=, relay=mail.example.com[private/dovecot-lmtp], delay=0.18, delays=0.04/0.06/0.03/0.05, tls=none, dsn=2.0.0, status=sent (250 2.0.0 q4u3IQDPBmorbygAi4598g Saved) + # ### sent if ($status eq 'sent') { -- 2.53.0