]> gitweb.michael.orlitzky.com - postfix-logwatch.git/commitdiff
postfix-logwatch: match postfix-3.11 tls=<value> field
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 15 May 2026 18:33:12 +0000 (14:33 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 15 May 2026 18:47:32 +0000 (14:47 -0400)
In postfix-3.11, a new tls=<value> 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

index 30cae44e7db5ef72d062d62e97a6d52a908b2376..3e9bba159658d4eda4a8241020407c7e7010d0b1 100755 (executable)
@@ -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=<value> 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=<to@sample.com>, 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=<to@sample.com>, 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=<to@example.net>, orig_to=<to-ext@example.net>, 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=<value> field is present:
+         #
+         #TD 4gGzkS37gTz3xBY: to=<user@example.com>, orig_to=<user@example.net>, 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 <user@example.com> q4u3IQDPBmorbygAi4598g Saved)
+         #
 
          ### sent
          if ($status eq 'sent') {