]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.10-20240927
authorWietse Z Venema <wietse@porcupine.org>
Fri, 27 Sep 2024 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <ietf-dane@dukhovni.org>
Sat, 28 Sep 2024 19:16:17 +0000 (05:16 +1000)
25 files changed:
postfix/HISTORY
postfix/README_FILES/TLSRPT_README
postfix/WISHLIST
postfix/html/TLSRPT_README.html
postfix/html/lmtp.8.html
postfix/html/postconf.5.html
postfix/html/smtp.8.html
postfix/man/man5/postconf.5
postfix/man/man8/smtp.8
postfix/mantools/postlink
postfix/proto/TLSRPT_README.html
postfix/proto/postconf.proto
postfix/proto/stop
postfix/proto/stop.double-history
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/smtp/lmtp_params.c
postfix/src/smtp/smtp.c
postfix/src/smtp/smtp_params.c
postfix/src/smtp/smtp_tlsrpt.c
postfix/src/tls/tls_client.c
postfix/src/tls/tls_proxy_client_print.c
postfix/src/tls/tls_proxy_client_scan.c
postfix/src/tls/tlsrpt_wrapper.c
postfix/src/tls/tlsrpt_wrapper.h

index d99d6aa8c7760f7ea85f3c88a08e5522d1a6e99d..3f5cdb27047853ab321a2533fb8959c7c79da3a9 100644 (file)
@@ -28301,3 +28301,15 @@ Apologies for any names omitted.
        File: mantools/check-snapshot-nonprod.
 
        First general Postfix release with TLSRPT support.
+
+20240927
+
+       Feature: new parameter smtp_tlsrpt_skip_reused_handshakes
+       (default: yes) to suppress TLSRPT status reports for TLS
+       handshakes that reuse a previously-negotiated TLS session
+       (there would be no new information to report). Specify "no"
+       for TLSRPT troubleshooting. Files: mantools/postlink,
+       proto/TLSRPT_README.html, proto/postconf.proto, smtp/smtp.c,
+       smtp/smtp_params.c, smtp/smtp_tlsrpt.c, tls/tls_client.c,
+       tls/tls_proxy_client_print.c, tls/tls_proxy_client_scan.c,
+       tls/tlsrpt_wrapper.c, tls/tlsrpt_wrapper.h.
index 55538a23a3a574620b835fcb89f8271689663871..9b797d2a72532d71ab04c1434634605383752ad8 100644 (file)
@@ -133,9 +133,12 @@ daemon:
     [ipaddr],
         failure_type=validation_failure, failure_reason=self-signed_certificate
 
-Note: Postfix logs and reports TLSRPT status only for TLS handshakes on a new
-SMTP connection. There is no TLSRPT status logging for a reused SMTP
-connection. Such connections have Postfix SMTP client logging like this:
+Notes:
+
+  * Postfix logs and reports the TLSRPT status only for TLS handshakes on a new
+    SMTP connection. There is no TLS handshake, and thus no TLSRPT status
+    logging, when an SMTP connection is reused. Such connections have Postfix
+    SMTP client logging like this:
 
     Verified T\bTL\bLS\bS c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn r\bre\beu\bus\bse\bed\bd to mail.example.com[ipaddr]:25:
         TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
@@ -143,25 +146,32 @@ connection. Such connections have Postfix SMTP client logging like this:
     Untrusted T\bTL\bLS\bS c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn r\bre\beu\bus\bse\bed\bd to mail.example.com[ipaddr]:25:
         TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
 
-Postfix logs certificate verification failures with a level of detail that is
-different for a new or reused TLS session.
+  * By default, Postfix does not report the TLSRPT status for a TLS handshake
+    that reuses a previously-negotiated TLS session (there would be no new
+    information to report). Specify "smtp_tlsrpt_skip_reused_handshakes = no"
+    to report the TLSRPT status for all TLS handshakes. This may be useful for
+    troubleshooting.
 
-  * A new TLS session is logged with certificate verification failure details:
+  * Postfix logging for certificate verification failures may differ between
+    new or reused TLS sessions.
 
-    TLSRPT: status=failure, domain=example.org, receiving_mx=mail.example.org
-    [ipaddr],
-        f\bfa\bai\bil\blu\bur\bre\be_\b_t\bty\byp\bpe\be=\b=v\bva\bal\bli\bid\bda\bat\bti\bio\bon\bn_\b_f\bfa\bai\bil\blu\bur\bre\be, f\bfa\bai\bil\blu\bur\bre\be_\b_r\bre\bea\bas\bso\bon\bn=\b=s\bse\bel\blf\bf-\b-s\bsi\big\bgn\bne\bed\bd_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be
+      o New TLS session:
 
-  * A reused TLS session is indicated as shown below, and has no certificate
-    verification details:
+        TLSRPT: status=failure, domain=example.org,
+        receiving_mx=mail.example.org[ipaddr],
+            f\bfa\bai\bil\blu\bur\bre\be_\b_t\bty\byp\bpe\be=\b=v\bva\bal\bli\bid\bda\bat\bti\bio\bon\bn_\b_f\bfa\bai\bil\blu\bur\bre\be, f\bfa\bai\bil\blu\bur\bre\be_\b_r\bre\bea\bas\bso\bon\bn=\b=s\bse\bel\blf\bf-\b-
+        s\bsi\big\bgn\bne\bed\bd_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be
 
-    mail.example.org[ipaddr]:25: r\bre\be-\b-u\bus\bsi\bin\bng\bg s\bse\bes\bss\bsi\bio\bon\bn with untrusted peer
-        credential, look for details earlier in the log
-    TLSRPT: status=failure, domain=example.org, receiving_mx=mail.example.org
-    [ipaddr],
-        f\bfa\bai\bil\blu\bur\bre\be_\b_t\bty\byp\bpe\be=\b=c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be_\b_n\bno\bot\bt_\b_t\btr\bru\bus\bst\bte\bed\bd
+      o Reused TLS session:
 
-Some Postfix users may wonder where the difference comes from. So this is why.
+        mail.example.org[ipaddr]:25: r\bre\be-\b-u\bus\bsi\bin\bng\bg s\bse\bes\bss\bsi\bio\bon\bn with untrusted peer
+            credential, look for details earlier in the log
+        TLSRPT: status=failure, domain=example.org,
+        receiving_mx=mail.example.org[ipaddr],
+            f\bfa\bai\bil\blu\bur\bre\be_\b_t\bty\byp\bpe\be=\b=c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be_\b_n\bno\bot\bt_\b_t\btr\bru\bus\bst\bte\bed\bd
+
+    The logging may differ because a reused TLS session does not have the
+    details for why TLS authentication failed.
 
 D\bDe\bel\bli\biv\bve\ber\bri\bin\bng\bg T\bTL\bLS\bSR\bRP\bPT\bT s\bsu\bum\bmm\bma\bar\bri\bie\bes\bs v\bvi\bia\ba e\bem\bma\bai\bil\bl
 
@@ -258,16 +268,16 @@ datatracker.ietf.org/doc/html/rfc8460#section-4.5.
 
 L\bLi\bim\bmi\bit\bta\bat\bti\bio\bon\bns\bs
 
-The Postfix TLSRPT implementation reports at most one final TLS handshake
-status (either 'success' or 'failure') per connection. Postfix TLSRPT cannot
-report a failure and then later report a final status of 'success' for that
-same connection. The reason is that it's too complicated to filter TLS errors
-and to report error details from the TLS engine back to the SMTP protocol
-engine. It just is not how Postfix works internally.
-
 The Postfix TLSRPT implementation reports only TLS handshake success or
-failure. It does not report failure to connect, or connections that break after
-a successful TLS handshake.
+failure. It does not report failure to connect, or connections that break
+before or after a TLS handshake.
+
+The Postfix TLSRPT implementation reports at most one final TLS handshake
+status (either 'success' or 'failure') per SMTP connection. Postfix TLSRPT will
+not report a recoverable failure and then later report a final status of
+'success' for that same connection. The reason is that it's too complicated to
+filter TLS errors and to report error details from the TLS engine back to the
+SMTP protocol engine. It just is not how Postfix works internally.
 
 C\bCr\bre\bed\bdi\bit\bts\bs
 
index 721fc9a58269ce041582382d67e77a6311f855c2..f12a1544a8513261ee384e369164c7b9da17323e 100644 (file)
@@ -7,7 +7,9 @@ Wish list:
        Disable -DSNAPSHOT and -DNONPROD in makedefs.
 
        Add smtp_tlsrpt_allow_list feature (default: static:all) to limit
-       the domains for which Postfix generates TLSRPT daily sumamries.
+       the domains for which Postfix generates TLSRPT daily summaries.
+
+       Rename TLS_SESS_STATE.rpt_reported to skip_tlsrpt_report.
 
        Add unit tests for smtp_tlsrpt.c, tlstrpd_wrapper.c, ...
 
index 9e6e6e073d36ff4d57900c44ef27a116ec697b1a..6edf95d500f3953b5ce5077f64bd210e0c18bcd2 100644 (file)
@@ -105,8 +105,8 @@ and MTA-STS (through an <a href="postconf.5.html#smtp_tls_policy_maps">smtp_tls_
 engine. With "<a href="postconf.5.html#smtp_tls_connection_reuse">smtp_tls_connection_reuse</a> = no", the <a href="smtp.8.html">smtp(8)</a> client
 process also implements the TLS client engine. With
 "<a href="postconf.5.html#smtp_tls_connection_reuse">smtp_tls_connection_reuse</a> = yes", the <a href="smtp.8.html">smtp(8)</a> client process
-delegates TLS processing to a Postfix <a href="tlsproxy.8.html">tlsproxy(8)</a> process.  Either
-way, Postfix will generate the exact same TLSRPT events.  </p>
+delegates TLS processing to a Postfix <a href="tlsproxy.8.html">tlsproxy(8)</a> process. Either
+way, Postfix will generate the exact same TLSRPT events. </p>
 
 <h2> <a name="building"> Building Postfix with TLSRPT support </a>
 </h2>
@@ -211,12 +211,15 @@ TLSRPT: status=failure, domain=example.net, receiving_mx=mail.example.net[ipaddr
 </pre>
 </blockquote>
 
-<p> Note: Postfix logs and reports TLSRPT status only for TLS
-handshakes on a new SMTP connection. There is no TLSRPT status
-logging for a reused SMTP connection. Such connections have 
-Postfix SMTP client logging like this: </p>
+<p> Notes: </p>
+
+<ul> 
+
+<li> <p> Postfix logs and reports the TLSRPT status only for TLS
+handshakes on a new SMTP connection. There is no TLS handshake, and
+thus no TLSRPT status logging, when an SMTP connection is reused.
+Such connections have Postfix SMTP client logging like this: </p>
 
-<blockquote> 
 <pre>
 Verified <b>TLS connection reused</b> to mail.example.com[ipaddr]:25:
     TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
@@ -224,23 +227,28 @@ Verified <b>TLS connection reused</b> to mail.example.com[ipaddr]:25:
 Untrusted <b>TLS connection reused</b> to mail.example.com[ipaddr]:25:
     TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
 </pre>
-</blockquote>
 
-<p> Postfix logs certificate verification failures with a level of
-detail that is different for a new or reused TLS session. </p>
+<li> <p> By default, Postfix does not report the TLSRPT status for
+a TLS handshake that reuses a previously-negotiated TLS session
+(there would be no new information to report). Specify
+"<a href="postconf.5.html#smtp_tlsrpt_skip_reused_handshakes">smtp_tlsrpt_skip_reused_handshakes</a> = no" to report the TLSRPT
+status for all TLS handshakes. This may be useful for troubleshooting.
+</p>
+
+<li> <p> Postfix logging for certificate verification failures may
+differ between new or reused TLS sessions. </p>
 
 <ul>
 
-<li> <p> A new TLS session is logged with certificate verification
-failure details: </p>
+<li> <p> New TLS session:
+</p>
 
 <pre>
 TLSRPT: status=failure, domain=example.org, receiving_mx=mail.example.org[ipaddr],
     <b>failure_type=validation_failure</b>, <b>failure_reason=self-signed_certificate</b>
 </pre>
 
-<li> <p> A reused TLS session is indicated as shown below, and has
-no certificate verification details: </p>
+<li> <p> Reused TLS session: </p>
 
 <pre>
 mail.example.org[ipaddr]:25: <b>re-using session</b> with untrusted peer
@@ -251,8 +259,10 @@ TLSRPT: status=failure, domain=example.org, receiving_mx=mail.example.org[ipaddr
 
 </ul>
 
-<p> Some Postfix users may wonder where the difference comes from.
-So this is why. </p>
+<p> The logging may differ because a reused TLS session does not
+have the details for why TLS authentication failed. </p>
+
+</ul>
 
 <h2> <a name="delivering"> Delivering TLSRPT summaries via email</a> </h2>
 
@@ -381,17 +391,17 @@ policy_failure=sts-webpki-invalid
 
 <h2> <a name="limitations"> Limitations </a></h2>
 
-<p> The Postfix TLSRPT implementation reports at most one final TLS
-handshake status (either 'success' or 'failure') per connection.
-Postfix TLSRPT cannot report a failure and then later report a final
-status of 'success' for that same connection. The reason is that
-it's too complicated to filter TLS errors and to report error details
-from the TLS engine back to the SMTP protocol engine. It just is
-not how Postfix works internally. </p>
-
 <p> The Postfix TLSRPT implementation reports only TLS handshake
 success or failure. It does not report failure to connect, or
-connections that break after a successful TLS handshake. </p>
+connections that break before or after a TLS handshake. </p>
+
+<p> The Postfix TLSRPT implementation reports at most one final TLS
+handshake status (either 'success' or 'failure') per SMTP connection.
+Postfix TLSRPT will not report a recoverable failure and then later
+report a final status of 'success' for that same connection. The
+reason is that it's too complicated to filter TLS errors and to
+report error details from the TLS engine back to the SMTP protocol
+engine. It just is not how Postfix works internally. </p>
 
 <h2> <a name="credits"> Credits </a> </h2>
 
index dbf71d264c765c9ea55d750e7f2cb689de37aad3..77820ea5b08922357f10b7d6eddace910860e4f7 100644 (file)
@@ -702,8 +702,8 @@ SMTP,(LMTP)                                                        SMTP,(LMTP)
        Available in Postfix version 3.2 and later:
 
        <b><a href="postconf.5.html#tls_eecdh_auto_curves">tls_eecdh_auto_curves</a> (see 'postconf -d' output)</b>
-              The prioritized list of elliptic curves supported by the Postfix
-              SMTP client and server.
+              The prioritized list of elliptic curves, that should be  enabled
+              in the Postfix SMTP client and server.
 
        Available in Postfix version 3.4 and later:
 
@@ -753,6 +753,11 @@ SMTP,(LMTP)                                                        SMTP,(LMTP)
               The pathname of a UNIX-domain datagram socket that is managed by
               a local TLSRPT reporting service.
 
+       <b><a href="postconf.5.html#smtp_tlsrpt_skip_reused_handshakes">smtp_tlsrpt_skip_reused_handshakes</a> (yes)</b>
+              Do not report the TLSRPT status for TLS protocol handshakes that
+              reuse a previously-negotiated  TLS  session  (there  is  no  new
+              information to report).
+
 <b>OBSOLETE STARTTLS CONTROLS</b>
        The  following  configuration  parameters  exist for compatibility with
        Postfix versions before 2.3. Support for these will  be  removed  in  a
index b703e66012866b1a2c3c6ba497eb5785b49c45ef..edfe80420ac085640c17e413b89fceaeed524c61 100644 (file)
@@ -14808,12 +14808,27 @@ Postfix versions. </p>
 <p> Enable support for <a href="https://tools.ietf.org/html/rfc8460">RFC 8460</a> TLSRPT notifications. A mail receiving
 domain can publish a TLSRPT policy in DNS, to request periodic
 summaries of successful and failed SMTP over TLS connections to
-their mail servers. This feature requires that Postfix is built
+their MX servers. This feature requires that Postfix is built
 with a TLSRPT supporting library. </p>
 
 <p> This feature is available in Postfix &ge; 3.10. </p>
 
 
+</DD>
+
+<DT><b><a name="smtp_tlsrpt_skip_reused_handshakes">smtp_tlsrpt_skip_reused_handshakes</a>
+(default: yes)</b></DT><DD>
+
+<p> Do not report the TLSRPT status for TLS protocol handshakes
+that reuse a previously-negotiated TLS session (there is no new
+information to report). Report the TLSRPT status only for "new" TLS
+sessions. Set this to "no" to log the TLSRPT status of all TLS
+handshakes, for example to troubleshoot Postfix TLSRPT support.
+</p>
+
+<p> This feature is available in Postfix &ge; 3.10. </p>
+
+
 </DD>
 
 <DT><b><a name="smtp_tlsrpt_socket_name">smtp_tlsrpt_socket_name</a>
index dbf71d264c765c9ea55d750e7f2cb689de37aad3..77820ea5b08922357f10b7d6eddace910860e4f7 100644 (file)
@@ -702,8 +702,8 @@ SMTP,(LMTP)                                                        SMTP,(LMTP)
        Available in Postfix version 3.2 and later:
 
        <b><a href="postconf.5.html#tls_eecdh_auto_curves">tls_eecdh_auto_curves</a> (see 'postconf -d' output)</b>
-              The prioritized list of elliptic curves supported by the Postfix
-              SMTP client and server.
+              The prioritized list of elliptic curves, that should be  enabled
+              in the Postfix SMTP client and server.
 
        Available in Postfix version 3.4 and later:
 
@@ -753,6 +753,11 @@ SMTP,(LMTP)                                                        SMTP,(LMTP)
               The pathname of a UNIX-domain datagram socket that is managed by
               a local TLSRPT reporting service.
 
+       <b><a href="postconf.5.html#smtp_tlsrpt_skip_reused_handshakes">smtp_tlsrpt_skip_reused_handshakes</a> (yes)</b>
+              Do not report the TLSRPT status for TLS protocol handshakes that
+              reuse a previously-negotiated  TLS  session  (there  is  no  new
+              information to report).
+
 <b>OBSOLETE STARTTLS CONTROLS</b>
        The  following  configuration  parameters  exist for compatibility with
        Postfix versions before 2.3. Support for these will  be  removed  in  a
index a9cf9d060b913df76aad0b62f06323839a54ca9a..92dc865185f54c04cf1655b4a57a09ef49dbd99c 100644 (file)
@@ -9864,10 +9864,18 @@ This feature is available in Postfix 3.0 and later.
 Enable support for RFC 8460 TLSRPT notifications. A mail receiving
 domain can publish a TLSRPT policy in DNS, to request periodic
 summaries of successful and failed SMTP over TLS connections to
-their mail servers. This feature requires that Postfix is built
+their MX servers. This feature requires that Postfix is built
 with a TLSRPT supporting library.
 .PP
 This feature is available in Postfix >= 3.10.
+.SH smtp_tlsrpt_skip_reused_handshakes (default: yes)
+Do not report the TLSRPT status for TLS protocol handshakes
+that reuse a previously\-negotiated TLS session (there is no new
+information to report). Report the TLSRPT status only for "new" TLS
+sessions. Set this to "no" to log the TLSRPT status of all TLS
+handshakes, for example to troubleshoot Postfix TLSRPT support.
+.PP
+This feature is available in Postfix >= 3.10.
 .SH smtp_tlsrpt_socket_name (default: empty)
 The pathname of a UNIX\-domain datagram socket that is managed
 by a local TLSRPT reporting service. This parameter must specify a
index a55d17636fcec64b2d0e2f8057d292f46012f285..966f51f4fc5441319fc61912011fb2425ee75c0d 100644 (file)
@@ -637,8 +637,8 @@ record was found via an "insecure" MX lookup.
 .PP
 Available in Postfix version 3.2 and later:
 .IP "\fBtls_eecdh_auto_curves (see 'postconf -d' output)\fR"
-The prioritized list of elliptic curves supported by the Postfix
-SMTP client and server.
+The prioritized list of elliptic curves, that should be enabled in the
+Postfix SMTP client and server.
 .PP
 Available in Postfix version 3.4 and later:
 .IP "\fBsmtp_tls_connection_reuse (no)\fR"
@@ -678,6 +678,10 @@ Enable support for RFC 8460 TLSRPT notifications.
 .IP "\fBsmtp_tlsrpt_socket_name (empty)\fR"
 The pathname of a UNIX\-domain datagram socket that is managed
 by a local TLSRPT reporting service.
+.IP "\fBsmtp_tlsrpt_skip_reused_handshakes (yes)\fR"
+Do not report the TLSRPT status for TLS protocol handshakes
+that reuse a previously\-negotiated TLS session (there is no new
+information to report).
 .SH "OBSOLETE STARTTLS CONTROLS"
 .na
 .nf
index 6e7ba6954f11dd7513df905e80896ced5048f20a..7ee74fba2978894152dc31baeb168662f15eaecf 100755 (executable)
@@ -723,8 +723,10 @@ while (<>) {
     s;\blmtp_tls_connection_reuse\b;<a href="postconf.5.html#lmtp_tls_connection_reuse">$&</a>;g;
     s;\bsmtp_tlsrpt_enable\b;<a href="postconf.5.html#smtp_tlsrpt_enable">$&</a>;g;
     s;\bsmtp_tlsrpt_socket_name\b;<a href="postconf.5.html#smtp_tlsrpt_socket_name">$&</a>;g;
+    s;\bsmtp_tlsrpt_skip_reused_handshakes\b;<a href="postconf.5.html#smtp_tlsrpt_skip_reused_handshakes">$&</a>;g;
     s;\blmtp_tlsrpt_enable\b;<a href="postconf.5.html#lmtp_tlsrpt_enable">$&</a>;g;
     s;\blmtp_tlsrpt_socket_name\b;<a href="postconf.5.html#lmtp_tlsrpt_socket_name">$&</a>;g;
+    s;\blmtp_tlsrpt_skip_reused_handshakes\b;<a href="postconf.5.html#lmtp_tlsrpt_skip_reused_handshakes">$&</a>;g;
     s;\bsmtpd_enforce_tls\b;<a href="postconf.5.html#smtpd_enforce_tls">$&</a>;g;
     s;\bsmtpd_sasl_tls_security_options\b;<a href="postconf.5.html#smtpd_sasl_tls_security_options">$&</a>;g;
     s;\bsmtpd_sasl_type\b;<a href="postconf.5.html#smtpd_sasl_type">$&</a>;g;
index 8210eae050bd97dc5b8f93dd9e7f3f70478877dc..3154c33e5e6e99151ef189064d4468d34f4b762f 100644 (file)
@@ -105,8 +105,8 @@ and MTA-STS (through an smtp_tls_policy_maps plug-in).
 engine. With "smtp_tls_connection_reuse = no", the smtp(8) client
 process also implements the TLS client engine. With
 "smtp_tls_connection_reuse = yes", the smtp(8) client process
-delegates TLS processing to a Postfix tlsproxy(8) process.  Either
-way, Postfix will generate the exact same TLSRPT events.  </p>
+delegates TLS processing to a Postfix tlsproxy(8) process. Either
+way, Postfix will generate the exact same TLSRPT events. </p>
 
 <h2> <a name="building"> Building Postfix with TLSRPT support </a>
 </h2>
@@ -211,12 +211,15 @@ TLSRPT: status=failure, domain=example.net, receiving_mx=mail.example.net[ipaddr
 </pre>
 </blockquote>
 
-<p> Note: Postfix logs and reports TLSRPT status only for TLS
-handshakes on a new SMTP connection. There is no TLSRPT status
-logging for a reused SMTP connection. Such connections have 
-Postfix SMTP client logging like this: </p>
+<p> Notes: </p>
+
+<ul> 
+
+<li> <p> Postfix logs and reports the TLSRPT status only for TLS
+handshakes on a new SMTP connection. There is no TLS handshake, and
+thus no TLSRPT status logging, when an SMTP connection is reused.
+Such connections have Postfix SMTP client logging like this: </p>
 
-<blockquote> 
 <pre>
 Verified <b>TLS connection reused</b> to mail.example.com[ipaddr]:25:
     TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
@@ -224,23 +227,28 @@ Verified <b>TLS connection reused</b> to mail.example.com[ipaddr]:25:
 Untrusted <b>TLS connection reused</b> to mail.example.com[ipaddr]:25:
     TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
 </pre>
-</blockquote>
 
-<p> Postfix logs certificate verification failures with a level of
-detail that is different for a new or reused TLS session. </p>
+<li> <p> By default, Postfix does not report the TLSRPT status for
+a TLS handshake that reuses a previously-negotiated TLS session
+(there would be no new information to report). Specify
+"smtp_tlsrpt_skip_reused_handshakes = no" to report the TLSRPT
+status for all TLS handshakes. This may be useful for troubleshooting.
+</p>
+
+<li> <p> Postfix logging for certificate verification failures may
+differ between new or reused TLS sessions. </p>
 
 <ul>
 
-<li> <p> A new TLS session is logged with certificate verification
-failure details: </p>
+<li> <p> New TLS session:
+</p>
 
 <pre>
 TLSRPT: status=failure, domain=example.org, receiving_mx=mail.example.org[ipaddr],
     <b>failure_type=validation_failure</b>, <b>failure_reason=self-signed_certificate</b>
 </pre>
 
-<li> <p> A reused TLS session is indicated as shown below, and has
-no certificate verification details: </p>
+<li> <p> Reused TLS session: </p>
 
 <pre>
 mail.example.org[ipaddr]:25: <b>re-using session</b> with untrusted peer
@@ -251,8 +259,10 @@ TLSRPT: status=failure, domain=example.org, receiving_mx=mail.example.org[ipaddr
 
 </ul>
 
-<p> Some Postfix users may wonder where the difference comes from.
-So this is why. </p>
+<p> The logging may differ because a reused TLS session does not
+have the details for why TLS authentication failed. </p>
+
+</ul>
 
 <h2> <a name="delivering"> Delivering TLSRPT summaries via email</a> </h2>
 
@@ -381,17 +391,17 @@ policy_failure=sts-webpki-invalid
 
 <h2> <a name="limitations"> Limitations </a></h2>
 
-<p> The Postfix TLSRPT implementation reports at most one final TLS
-handshake status (either 'success' or 'failure') per connection.
-Postfix TLSRPT cannot report a failure and then later report a final
-status of 'success' for that same connection. The reason is that
-it's too complicated to filter TLS errors and to report error details
-from the TLS engine back to the SMTP protocol engine. It just is
-not how Postfix works internally. </p>
-
 <p> The Postfix TLSRPT implementation reports only TLS handshake
 success or failure. It does not report failure to connect, or
-connections that break after a successful TLS handshake. </p>
+connections that break before or after a TLS handshake. </p>
+
+<p> The Postfix TLSRPT implementation reports at most one final TLS
+handshake status (either 'success' or 'failure') per SMTP connection.
+Postfix TLSRPT will not report a recoverable failure and then later
+report a final status of 'success' for that same connection. The
+reason is that it's too complicated to filter TLS errors and to
+report error details from the TLS engine back to the SMTP protocol
+engine. It just is not how Postfix works internally. </p>
 
 <h2> <a name="credits"> Credits </a> </h2>
 
index 0e6cd26b588efb1139a6bd6b169e2cfb2168c8ce..dcbc8b2cceba225f44cbb6d6374a77a074ecc4f7 100644 (file)
@@ -19414,7 +19414,7 @@ length limit. </p>
 <p> Enable support for RFC 8460 TLSRPT notifications. A mail receiving
 domain can publish a TLSRPT policy in DNS, to request periodic
 summaries of successful and failed SMTP over TLS connections to
-their mail servers. This feature requires that Postfix is built
+their MX servers. This feature requires that Postfix is built
 with a TLSRPT supporting library. </p>
 
 <p> This feature is available in Postfix &ge; 3.10. </p>
@@ -19427,3 +19427,14 @@ pathname (absolute, or relative to $queue_directory) when
 "smtp_tlsrpt_enable = yes". </p>
 
 <p> This feature is available in Postfix &ge; 3.10. </p>
+
+%PARAM smtp_tlsrpt_skip_reused_handshakes yes
+
+<p> Do not report the TLSRPT status for TLS protocol handshakes
+that reuse a previously-negotiated TLS session (there is no new
+information to report). Report the TLSRPT status only for "new" TLS
+sessions. Set this to "no" to log the TLSRPT status of all TLS
+handshakes, for example to troubleshoot Postfix TLSRPT support.
+</p>
+
+<p> This feature is available in Postfix &ge; 3.10. </p>
index 4755ed24f610c8024cee73d4173de8f50499e01e..1160a4bc5705fb88e60c25ebd95b4da97e0f49ec 100644 (file)
@@ -1651,3 +1651,4 @@ parsable
 mailto
 ipaddr
 STS
+hs
index 70a09313adf692da0e1ccde8b9b572ac02d245c0..3a720a5d8b665570b03de28a3ca448cd820f9843 100644 (file)
@@ -131,3 +131,4 @@ proto  proto mysql_table proto pgsql_table proto ldap_table
  cleanup cleanup h cleanup cleanup_extracted c 
  File postcat postcat c 
  Files src tls tls h src tls tls_dh c src tls tls_misc c 
+ proto TLSRPT_README html proto postconf proto smtp smtp c 
index d209bc03656191e69a2ce24564c0efb4c4989d3d..8e02d12f515d52a77d3c737033ae8d702a99c6ec 100644 (file)
@@ -4475,6 +4475,12 @@ extern bool var_smtp_tlsrpt_enable;
 #define DEF_LMTP_TLSRPT_SOCKNAME DEF_SMTP_TLSRPT_SOCKNAME
 extern char *var_smtp_tlsrpt_sockname;
 
+#define VAR_SMTP_TLSRPT_SKIP_REUSED_HS "smtp_tlsrpt_skip_reused_handshakes"
+#define DEF_SMTP_TLSRPT_SKIP_REUSED_HS "yes"
+#define VAR_LMTP_TLSRPT_SKIP_REUSED_HS "lmtp_tlsrpt_skip_reused_handshakes"
+#define DEF_LMTP_TLSRPT_SKIP_REUSED_HS DEF_SMTP_TLSRPT_SKIP_REUSED_HS
+extern int var_smtp_tlsrpt_skip_reused_hs;
+
 /* LICENSE
 /* .ad
 /* .fi
index 56082f7d9d0b921b106323e5d10a8efd4bca20d8..7eced915ff6800ff244d5a93f51fb0d36c470330 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20240926"
+#define MAIL_RELEASE_DATE      "20240927"
 #define MAIL_VERSION_NUMBER    "3.10"
 
 #ifdef SNAPSHOT
index c41cf91aec5d995fd144b49c70d617dce4367656..b77500326e186fc10ecdf89cb4a37fb8b5bb9ae4 100644 (file)
     static const CONFIG_NBOOL_TABLE lmtp_nbool_table[] = {
        VAR_LMTP_REQ_DEADLINE, DEF_LMTP_REQ_DEADLINE, &var_smtp_req_deadline,
        VAR_LMTP_TLSRPT_ENABLE, DEF_LMTP_TLSRPT_ENABLE, &var_smtp_tlsrpt_enable,
+       VAR_LMTP_TLSRPT_SKIP_REUSED_HS, DEF_LMTP_TLSRPT_SKIP_REUSED_HS, &var_smtp_tlsrpt_skip_reused_hs,
        0,
     };
index 23ce94ebfa6aad073a04744e80266a8fc575127b..b06535979e382f591688a2caf2cd5ef64625a4e0 100644 (file)
 /* .PP
 /*     Available in Postfix version 3.2 and later:
 /* .IP "\fBtls_eecdh_auto_curves (see 'postconf -d' output)\fR"
-/*     The prioritized list of elliptic curves supported by the Postfix
-/*     SMTP client and server.
+/*     The prioritized list of elliptic curves, that should be enabled in the
+/*     Postfix SMTP client and server.
 /* .PP
 /*     Available in Postfix version 3.4 and later:
 /* .IP "\fBsmtp_tls_connection_reuse (no)\fR"
 /* .IP "\fBsmtp_tlsrpt_socket_name (empty)\fR"
 /*     The pathname of a UNIX-domain datagram socket that is managed
 /*     by a local TLSRPT reporting service.
+/* .IP "\fBsmtp_tlsrpt_skip_reused_handshakes (yes)\fR"
+/*     Do not report the TLSRPT status for TLS protocol handshakes
+/*     that reuse a previously-negotiated TLS session (there is no new
+/*     information to report).
 /* OBSOLETE STARTTLS CONTROLS
 /* .ad
 /* .fi
@@ -1154,6 +1158,7 @@ bool    var_ign_srv_lookup_err;
 bool    var_allow_srv_fallback;
 bool    var_smtp_tlsrpt_enable;
 char   *var_smtp_tlsrpt_sockname;
+bool    var_smtp_tlsrpt_skip_reused_hs;
 
  /* Special handling of 535 AUTH errors. */
 char   *var_smtp_sasl_auth_cache_name;
index f58f9eb3461e7e86892b9de9eab18eb58af31e6c..6d80ef105dc915db38cdb6832871a035492cbc25 100644 (file)
     static const CONFIG_NBOOL_TABLE smtp_nbool_table[] = {
        VAR_SMTP_REQ_DEADLINE, DEF_SMTP_REQ_DEADLINE, &var_smtp_req_deadline,
        VAR_SMTP_TLSRPT_ENABLE, DEF_SMTP_TLSRPT_ENABLE, &var_smtp_tlsrpt_enable,
+       VAR_SMTP_TLSRPT_SKIP_REUSED_HS, DEF_SMTP_TLSRPT_SKIP_REUSED_HS, &var_smtp_tlsrpt_skip_reused_hs,
        0,
     };
index cfb8c55450f02e4f23b299ba46f60a94689673e3..23dc5f766587f5bdcf8f2bd7cab5d67b53b2c7e7 100644 (file)
@@ -253,7 +253,8 @@ void    smtp_tlsrpt_create_wrapper(SMTP_STATE *state, const char *domain)
        state->tlsrpt = trw_create(
                            /* rpt_socket_name= */ var_smtp_tlsrpt_sockname,
                                    /* rpt_policy_domain= */ adomain,
-                                   /* rpt_policy_string= */ rr->data);
+                                   /* rpt_policy_string= */ rr->data,
+                   /* skip_reused_hs = */ var_smtp_tlsrpt_skip_reused_hs);
        dns_rr_free(rr);
     } else {
        if (msg_verbose)
index a635767dc656ba1911a8efaf5fd93af57bdb50c6..9c5528db697621e9d79463d23ed8f4db15d2ed61 100644 (file)
@@ -1424,12 +1424,15 @@ TLS_SESS_STATE *tls_client_post_connect(TLS_SESS_STATE *TLScontext,
      * connection. It is never called for a reused TCP connection.
      * 
      * Inform the caller that they should not generate a TLSRPT 'success' or
-     * 'failure' event: this TLS protocol engine has already generated a
-     * TLSRPT 'failure' event for this session.
+     * 'failure' event: either this TLS protocol engine has already generated
+     * a TLSRPT 'failure' event for this session, or this is a reused TLS
+     * session.
      */
 #ifdef USE_TLSRPT
     TLScontext->rpt_reported = props->tlsrpt != 0
-       && trw_is_reported(props->tlsrpt);
+       && (trw_is_reported(props->tlsrpt)
+           || (TLScontext->session_reused
+               && trw_is_skip_reused_hs(props->tlsrpt)));
 #endif
 
     return (TLScontext);
index ae378cb7ec709931f1e51f2d2b66a8aa6044644e..68d8394ce70c3066eb0696ab0207f5b8a1f3c5a8 100644 (file)
@@ -287,6 +287,8 @@ static int tls_proxy_client_tlsrpt_print(ATTR_PRINT_COMMON_FN print_fn,
                                     STRING_OR_EMPTY(trw->rcv_mta_addr)),
                       SEND_ATTR_STR(TRW_DST_MTA_EHLO,
                                     STRING_OR_EMPTY(trw->rcv_mta_ehlo)),
+                      SEND_ATTR_INT(TRW_SKIP_REUSED_HS,
+                                    trw->skip_reused_hs),
                       SEND_ATTR_INT(TRW_FLAGS,
                                     trw->flags),
                       ATTR_TYPE_END);
index 7b25f71af0c889efdd28f489eaf12cbfe9fff03d..685f9e12487c94ab7d0fd6a0e224385cfd09dff1 100644 (file)
@@ -467,6 +467,7 @@ static int tls_proxy_client_tlsrpt_scan(ATTR_SCAN_COMMON_FN scan_fn,
        VSTRING *rcv_mta_name = vstring_alloc(100);
        VSTRING *rcv_mta_addr = vstring_alloc(100);
        VSTRING *rcv_mta_ehlo = vstring_alloc(100);
+       int     skip_reused_hs;
        int     trw_flags;
 
        ret = scan_fn(fp, flags | ATTR_FLAG_MORE,
@@ -481,6 +482,7 @@ static int tls_proxy_client_tlsrpt_scan(ATTR_SCAN_COMMON_FN scan_fn,
                      RECV_ATTR_STR(TRW_DST_MTA_NAME, rcv_mta_name),
                      RECV_ATTR_STR(TRW_DST_MTA_ADDR, rcv_mta_addr),
                      RECV_ATTR_STR(TRW_DST_MTA_EHLO, rcv_mta_ehlo),
+                     RECV_ATTR_INT(TRW_SKIP_REUSED_HS, &skip_reused_hs),
                      RECV_ATTR_INT(TRW_FLAGS, &trw_flags),
                      ATTR_TYPE_END);
 
@@ -497,8 +499,9 @@ static int tls_proxy_client_tlsrpt_scan(ATTR_SCAN_COMMON_FN scan_fn,
        EXPORT_OR_NULL(trw->rcv_mta_name, rcv_mta_name);
        EXPORT_OR_NULL(trw->rcv_mta_addr, rcv_mta_addr);
        EXPORT_OR_NULL(trw->rcv_mta_ehlo, rcv_mta_ehlo);
+       trw->skip_reused_hs = skip_reused_hs;
        trw->flags = trw_flags;
-       ret = (ret == 12 ? 1 : -1);
+       ret = (ret == 13 ? 1 : -1);
        if (ret != 1) {
            trw_free(trw);
            trw = 0;
index 176e4015c12f8a95d19ce62d2caddce495e6170a..11d06434de2d6c22bf59cf406607003b58fd24f1 100644 (file)
@@ -11,7 +11,8 @@
 /*     TLS_RPT *trw_create(
 /*     const char *rpt_socket_name,
 /*     const char *rpt_policy_domain,
-/*     const char *rpt_policy_string)
+/*     const char *rpt_policy_string,
+/*     int     skip_reused_hs)
 /*
 /*     void    trw_free(
 /*     TLSRPT_WRAPPER *trw)
@@ -45,6 +46,9 @@
 /*     int     trw_is_reported(
 /*     TLSRPT_WRAPPER *trw)
 /*
+/*     int     trw_is_skip_reused_hs(
+/*     TLSRPT_WRAPPER *trw)
+/*
 /*     tlsrpt_policy_type_t convert_tlsrpt_policy_type(
 /*     const char *policy_type)
 /*
 /* .IP rpt_policy_string
 /*     The TLSRPT policy record content, i.e. how to submit TLSRPT
 /*     summary reports.
+/* .IP skip_reused_hs
+/*     If non-zero, do not report the TLSRPT status for TLS handshakes
+/*     that reuse a previously-negotiated TLS session; such sessions
+/*     were already reported when they were used for the first time.
 /* .PP
 /*     trw_free() destroys storage allocated with other trw_xxx()
 /*     requests.
 /*     trw_is_reported() returns non-zero when the contents of the
 /*     specified TLSRPT_WRAPPER have been reported.
 /* .PP
+/*     trw_is_skip_reused_hs() returns non-zero if the skip_reused_hs
+/*     argument of trw_create() was non-zero.
+/* .PP
 /*     convert_tlsrpt_policy_type() and convert_tlsrpt_policy_failure()
 /*     convert a valid policy type or failure name to the corresponding
 /*     enum value. The result is < 0 if the name is not valid.
 
 TLSRPT_WRAPPER *trw_create(const char *rpt_socket_name,
                                   const char *rpt_policy_domain,
-                                  const char *rpt_policy_string)
+                                  const char *rpt_policy_string,
+                                  int skip_reused_hs)
 {
     TLSRPT_WRAPPER *trw;
 
@@ -317,6 +329,7 @@ TLSRPT_WRAPPER *trw_create(const char *rpt_socket_name,
     trw->rcv_mta_name = 0;
     trw->rcv_mta_addr = 0;
     trw->rcv_mta_ehlo = 0;
+    trw->skip_reused_hs = skip_reused_hs;
     trw->flags = 0;
     return (trw);
 }
@@ -623,6 +636,13 @@ int     trw_is_reported(const TLSRPT_WRAPPER *trw)
     return (trw->flags & TRW_FLAG_REPORTED);
 }
 
+/* trw_is_skip_reused_hs - don't report TLS handshakes that reuse a session */
+
+int     trw_is_skip_reused_hs(const TLSRPT_WRAPPER *trw)
+{
+    return (trw->skip_reused_hs);
+}
+
 #endif                                 /* USE_TLS_RPT */
 
  /*
index 57daff16fa90415aab310341573810dad145b509..569def4508bec5b2d4a6fc55d5bce23ae406d6fc 100644 (file)
@@ -31,7 +31,8 @@ typedef struct TLSRPT_WRAPPER TLSRPT_WRAPPER;
 
 extern TLSRPT_WRAPPER *trw_create(const char *rpt_socket_name,
                                          const char *rpt_policy_domain,
-                                         const char *rpt_policy_string);
+                                         const char *rpt_policy_string,
+                                         int skip_reused_hs);
 extern void trw_free(TLSRPT_WRAPPER *trw);
 extern void trw_set_tls_policy(TLSRPT_WRAPPER *trw,
                                       tlsrpt_policy_type_t tls_policy_type,
@@ -50,6 +51,7 @@ extern int trw_report_failure(TLSRPT_WRAPPER *trw,
                                      const char *failure_reason);
 extern int trw_report_success(TLSRPT_WRAPPER *trw);
 extern int trw_is_reported(const TLSRPT_WRAPPER *trw);
+extern int trw_is_skip_reused_hs(const TLSRPT_WRAPPER *trw);
 
  /*
   * The internals declarations are also needed for functions that transmit
@@ -67,6 +69,7 @@ struct TLSRPT_WRAPPER {
     char   *rpt_socket_name;
     char   *rpt_policy_domain;
     char   *rpt_policy_string;
+    int     skip_reused_hs;
     /* Set with trw_set_policy(). */
     tlsrpt_policy_type_t tls_policy_type;
     ARGV   *tls_policy_strings;
@@ -89,6 +92,7 @@ struct TLSRPT_WRAPPER {
 #define TRW_RPT_SOCKET_NAME    "rpt_socket_name"
 #define TRW_RPT_POLICY_DOMAIN  "rpt_policy_domain"
 #define TRW_RPT_POLICY_STRING  "rpt_policy_string"
+#define TRW_SKIP_REUSED_HS     "skip_reused_hs"
 #define TRW_TLS_POLICY_TYPE    "tls_policy_type"
 #define TRW_TLS_POLICY_STRINGS "tls_policy_strings"    /* XXX Not checked */
 #define TRW_TLS_POLICY_DOMAIN  "tls_policy_domain"