]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.9.2 v3.9.2
authorWietse Z Venema <wietse@porcupine.org>
Sun, 16 Feb 2025 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <ietf-dane@dukhovni.org>
Mon, 17 Feb 2025 04:58:28 +0000 (15:58 +1100)
22 files changed:
postfix/HISTORY
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/proto/postconf.proto
postfix/src/bounce/bounce_notify_util.c
postfix/src/cleanup/cleanup_message.c
postfix/src/global/dict_mysql.c
postfix/src/global/dict_pgsql.c
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/global/smtputf8.h
postfix/src/oqmgr/Makefile.in
postfix/src/oqmgr/qmgr_message.c
postfix/src/qmgr/Makefile.in
postfix/src/qmgr/qmgr_message.c
postfix/src/smtp/smtp.c
postfix/src/tls/tls_dh.c
postfix/src/tls/tls_misc.c
postfix/src/util/peekfd.c

index 7cf0f3e4eea187fcae00a51a04a356fafa23994f..a834480fc60d9a955be2a3155839d8b9302e65da 100644 (file)
@@ -28023,3 +28023,78 @@ Apologies for any names omitted.
        by Postfix (for example, a From: header with UTF8 full name
        information from the password file). Reported by Michael
        Tokarev. File: src/cleanup/cleanup_message.c.
+
+20241205
+
+       Portability: include <sys_socket.h> for a SUNOS5 workaround.
+       Gary R. Schmidt. File: util/peekfd.c.
+
+20241230
+
+       Bugfix (defect introduced: Postfix 3.3, date 20180107) small
+       memory leak in the cleanup daemon when generating a "From:
+       full-name <addr-spec>" message header. The impact is limited
+       because the number of requests is bounded by the "max_use"
+       configuration parameter. Found during code maintenance.
+       File: cleanup/cleanup_message.c.
+
+20250111
+
+       Forward compatibility: ignore new queue file flag bits that may
+       be used with Postfix 3.10 and later. This is a safety in case
+       a Postfix 3.10 upgrade needs to be rolled back, after the new
+       TLS-Required feature has been used. Files: global/smtputf8.h,
+       *qmgr/qmgr_message.c.
+20250115
+
+       Bugfix (defect introduced: Postfix 3.0): the bounce daemon
+       mangled a non-ASCII address localpart in the "X-Postfix-Sender:"
+       field of a delivery status notification. It backslash-escaped
+       each byte in a multi-byte character. This behavior was
+       implemented in Postfix 2.1 (no support for UTF8 local-parts),
+       but it became incorrect after SMTPUTF8 support was implemented
+       in Postfix 3.0. File: bounce/bounce_notify_util.c.
+
+20250207
+
+       Performance: when a mysql: or pgsql: configuration specifies
+       a single host, assume that it is a load balancer and reconnect
+       immediately after a single failure, instead of failing all
+       requests for 60s. Files: global/dict_pgsql.c, global/dict_mysql.c.
+
+20250210
+
+       Bugfix (defect introduced: Postfix 3.6): Reverted the default
+       smtp_tls_dane_insecure_mx_policy setting to "dane" as of Postfix
+       3.6.17, 3.7.13, 3.8.8, 3.9.2, and 3.10.0. By mistake the default
+       was dependent on the smtp_tls_security_level setting. Files:
+       global/mail_params.h, proto/postconf.proto, smtp/smtp.c.
+
+20250212
+
+       Support for OpenSSL 3.5 post-quantum cryptography. To manage
+       algorithm selection, OpenSSL introduces new TLS group syntax
+       that Postfix will not attempt to imitate. Instead, Postfix
+       now allows the tls_eecdh_auto_curves and tls_ffdhe_auto_groups
+       parameter values to have an empty value. When both are set
+       empty, the algorithm selection can be managed through OpenSSL
+       configuration. Viktor Dukhovni. Files: tls/tls_dh.c,
+       tls/tls_misc.c.
+
+       Bugfix (defect introduced: Postfix 3.4, date 20181113): a
+       server with multiple TLS certificates could report, for a
+       resumed TLS session, the wrong server-signature and
+       server-digest names in logging and Received: message headers.
+       Viktor Dukhovni. File: tls/tls_misc.c.
+
+20250213
+
+       Documentation: updated postconf(5) that the parameters
+       smtpd_tls_eecdh_grade, tls_eecdh_strong_curve,
+       tls_eecdh_ultra_curve, and tlsproxy_tls_eecdh_grade, are
+       not used since Postfix 3.6; updated the tls_eecdh_auto_curves
+       and tls_ffdhe_auto_groups description with post-quantum
+       configuration; added a post-quantum example to the
+       tls_config_file description. File: proto/postconf.proto.
+       The unused parameters will be deleted in Postfix 3.11.
index 4cc187c75174313bead975256ac969be83787590..b1abeff6b99fd6fd1b6afde1ecdba9d8bd06411d 100644 (file)
@@ -694,7 +694,7 @@ SMTP,(LMTP)                                                        SMTP,(LMTP)
 
        Available in Postfix version 3.1 and later:
 
-       <b><a href="postconf.5.html#smtp_tls_dane_insecure_mx_policy">smtp_tls_dane_insecure_mx_policy</a> (see 'postconf -d' output)</b>
+       <b><a href="postconf.5.html#smtp_tls_dane_insecure_mx_policy">smtp_tls_dane_insecure_mx_policy</a> (dane)</b>
               The TLS policy for MX hosts with "secure" TLSA records when  the
               nexthop  destination  security  level is <b>dane</b>, but the MX record
               was found via an "insecure" MX lookup.
index 0ac9b68c73e06a53ef2851831f282adf8642059c..fbd317a868170e76d220942b8d3c8195a2c78596 100644 (file)
@@ -13130,7 +13130,7 @@ TLS connection reuse</a>" for background details. </p>
 </DD>
 
 <DT><b><a name="smtp_tls_dane_insecure_mx_policy">smtp_tls_dane_insecure_mx_policy</a>
-(default: see "postconf -d" output)</b></DT><DD>
+(default: dane)</b></DT><DD>
 
 <p> The TLS policy for MX hosts with "secure" TLSA records when the
 nexthop destination security level is <b>dane</b>, but the MX
@@ -13154,10 +13154,9 @@ authentication succeeds, it will be logged only as "Trusted", not
 "Verified", because the MX host name could have been forged.  </dd>
 </dl>
 
-<p> The default setting for Postfix &ge; 3.6 is "dane" with
-"<a href="postconf.5.html#smtp_tls_security_level">smtp_tls_security_level</a> = dane", otherwise "may". This behavior
-was backported to Postfix versions 3.5.9, 3.4.19, 3.3.16. 3.2.21.
-With earlier Postfix versions the default setting was always "dane".
+<p> The default setting is "dane" as of Postfix versions 3.6.17,
+3.7.13, 3.8.8, 3.9.2, and 3.10.0. With earlier versions the default
+was mistakenly dependent on the <a href="postconf.5.html#smtp_tls_security_level">smtp_tls_security_level</a> setting.
 </p>
 
 <p> Though with "insecure" MX records an active attacker can
@@ -18609,6 +18608,8 @@ this parameter is always ignored, and Postfix behaves as though the
 <b>auto</b> value (described below) was chosen.
 </p>
 
+<p> This feature is not used as of Postfix 3.6. Do not specify. </p>
+
 <p> The available choices are: </p>
 
 <dl>
@@ -19808,6 +19809,45 @@ MinProtocol = TLSv1
 </pre>
 </blockquote>
 
+<p> Example: Custom OpenSSL group settings. </p>
+
+<pre>
+<a href="postconf.5.html">main.cf</a>:
+    <a href="postconf.5.html#tls_config_file">tls_config_file</a> = ${<a href="postconf.5.html#config_directory">config_directory</a>}/openssl.cnf
+    <a href="postconf.5.html#tls_config_name">tls_config_name</a> = postfix
+</pre>
+
+<pre>
+openssl.cnf:
+    postfix = postfix_settings
+</pre>
+
+<pre>
+    [postfix_settings]
+    ssl_conf = postfix_ssl_settings
+</pre>
+
+<pre>
+    [postfix_ssl_settings]
+    system_default = baseline_postfix_settings
+</pre>
+
+<pre>
+    [baseline_postfix_settings]
+    # New OpenSSL 3.5 syntax, for older releases consider
+    # the Postfix default:
+    #
+    # Groups = X25519:X448:prime256v1:secp384r1:secp521r1:ffdhe2048:ffdhe3072
+    #
+    Groups = *X25519MLKEM768 / *X25519:X448 / P-256:P-384
+</pre>
+
+<p> Caution: It is typically best to just use the default OpenSSL
+group settings, by setting "<a href="postconf.5.html#tls_config_file">tls_config_file</a> = none". Overly strict
+system-wide TLS settings will conflict with Postfix's opportunistic
+TLS, where being less restrictive is better than downgrading to
+cleartext SMTP. </p>
+
 <p> This feature is available in Postfix &ge; 3.9, 3.8.1, 3.7.6,
 3.6.10, and 3.5.20. </p>
 
@@ -19999,8 +20039,7 @@ be using 0.9.6! </dd>
 (default: see "postconf -d" output)</b></DT><DD>
 
 <p> The prioritized list of elliptic curves supported by the Postfix
-SMTP client and server.  These curves are used by the Postfix SMTP
-server when "<a href="postconf.5.html#smtpd_tls_eecdh_grade">smtpd_tls_eecdh_grade</a> = auto".  The selected curves must be
+SMTP client and server. The selected curves must be
 implemented by OpenSSL and be standardized for use in TLS (<a href="https://tools.ietf.org/html/rfc8422">RFC 8422</a>).
 It is unwise to list only "bleeding-edge" curves supported by a small
 subset of clients.  The default list is suitable for most users. </p>
@@ -20019,6 +20058,14 @@ customizing the list of FFDHE groups enabled with TLS 1.3.  That setting
 is introduced with Postfix 3.8, when built against OpenSSL 3.0 or later.
 </p>
 
+<p> Post-quantum cryptography support: OpenSSL 3.5 introduces new
+configuration syntax that Postfix will not attempt to imitate.
+Instead, with Postfix 3.6.17, 3.7.13, 3.8.8, 3.9.2, and later, set
+both <a href="postconf.5.html#tls_eecdh_auto_curves">tls_eecdh_auto_curves</a> and if available <a href="postconf.5.html#tls_ffdhe_auto_groups">tls_ffdhe_auto_groups</a>
+to the empty value, to enable algorithm selection through OpenSSL
+configuration. See <a href="postconf.5.html#tls_config_file">tls_config_file</a> for a configuration example.
+</p>
+
 <p> This feature is available in Postfix 3.2 and later, when it is
 compiled and linked with OpenSSL 1.0.2 or later on platforms where
 EC algorithms have not been disabled by the vendor. </p>
@@ -20042,6 +20089,8 @@ must support this curve for EECDH key exchange to take place.  It
 is unwise to choose only "bleeding-edge" curves supported by only a
 small subset of clients.  </p>
 
+<p> This feature is not used as of Postfix 3.6. Do not specify. </p>
+
 <p> The default "strong" curve is rated in NSA <a
 href="https://web.archive.org/web/20160330034144/https://www.nsa.gov/ia/programs/suiteb_cryptography/">Suite
 B</a> for information classified up to SECRET.  </p>
@@ -20086,6 +20135,8 @@ client implementations must support this curve for EECDH key exchange
 to take place.  It is unwise to choose only "bleeding-edge" curves
 supported by only a small subset of clients. </p>
 
+<p> This feature is not used as of Postfix 3.6. Do not specify. </p>
+
 <p> This default "ultra" curve is rated in NSA <a
 href="https://web.archive.org/web/20160330034144/https://www.nsa.gov/ia/programs/suiteb_cryptography/">Suite
 B</a> for information classified up to TOP SECRET. </p>
@@ -20162,10 +20213,15 @@ on whether any of the "kDHE" ciphers are included in the cipherlist.
 </p>
 
 <p> Conversely, setting "<a href="postconf.5.html#tls_eecdh_auto_curves">tls_eecdh_auto_curves</a>" empty disables TLS 1.3
-EC key agreement in OpenSSL 3.0 and later.  Note that at least one of
-"<a href="postconf.5.html#tls_eecdh_auto_curves">tls_eecdh_auto_curves</a>" and "<a href="postconf.5.html#tls_ffdhe_auto_groups">tls_ffdhe_auto_groups</a>" must be non-empty,
-this is required by OpenSSL 3.0.  If both are inadvertently set empty,
-Postfix will fall back to the compiled-in defaults. </p>
+EC key agreement in OpenSSL 3.0 and later. If both are set empty,
+Postfix will fall back to OpenSSL preferences as described next. </p>
+
+<p> Post-quantum cryptography support: OpenSSL 3.5 introduces new
+configuration syntax that Postfix will not attempt to imitate.
+Instead, with Postfix 3.6.17, 3.7.13, 3.8.8, 3.9.2, and later, set
+both <a href="postconf.5.html#tls_eecdh_auto_curves">tls_eecdh_auto_curves</a> and <a href="postconf.5.html#tls_ffdhe_auto_groups">tls_ffdhe_auto_groups</a> to the empty
+value, to enable algorithm selection through OpenSSL configuration.
+See <a href="postconf.5.html#tls_config_file">tls_config_file</a> for a configuration example. </p>
 
 <p> All the default groups and EC curves should sufficiently strong
 to make "pruning" the defaults unwise.  At a minimum, "X25519" and
@@ -21103,7 +21159,7 @@ the "<a href="postconf.5.html#tlsproxy_tls_chain_files">tlsproxy_tls_chain_files
 elliptic-curve Diffie-Hellman (EECDH) key exchange. See
 <a href="postconf.5.html#smtpd_tls_eecdh_grade">smtpd_tls_eecdh_grade</a> for further details. </p>
 
-<p> This feature is deprecated as of Postfix 3.9. Do not specify. </p>
+<p> This feature is not used as of Postfix 3.6. Do not specify. </p>
 
 <p> This feature is available in Postfix 2.8 and later. </p>
 
index 4cc187c75174313bead975256ac969be83787590..b1abeff6b99fd6fd1b6afde1ecdba9d8bd06411d 100644 (file)
@@ -694,7 +694,7 @@ SMTP,(LMTP)                                                        SMTP,(LMTP)
 
        Available in Postfix version 3.1 and later:
 
-       <b><a href="postconf.5.html#smtp_tls_dane_insecure_mx_policy">smtp_tls_dane_insecure_mx_policy</a> (see 'postconf -d' output)</b>
+       <b><a href="postconf.5.html#smtp_tls_dane_insecure_mx_policy">smtp_tls_dane_insecure_mx_policy</a> (dane)</b>
               The TLS policy for MX hosts with "secure" TLSA records when  the
               nexthop  destination  security  level is <b>dane</b>, but the MX record
               was found via an "insecure" MX lookup.
index cf96e48cb7f238ef5dd0f14cf1c1a0241d30d388..d6e333c9dd9f2572730d1f5e04c16c0ade8d1bae 100644 (file)
@@ -8589,7 +8589,7 @@ See "Client\-side
 TLS connection reuse" for background details.
 .PP
 This feature is available in Postfix 3.4 and later.
-.SH smtp_tls_dane_insecure_mx_policy (default: see "postconf \-d" output)
+.SH smtp_tls_dane_insecure_mx_policy (default: dane)
 The TLS policy for MX hosts with "secure" TLSA records when the
 nexthop destination security level is \fBdane\fR, but the MX
 record was found via an "insecure" MX lookup.  The choices are:
@@ -8610,10 +8610,9 @@ authentication succeeds, it will be logged only as "Trusted", not
 "Verified", because the MX host name could have been forged.
 .br
 .br
-The default setting for Postfix >= 3.6 is "dane" with
-"smtp_tls_security_level = dane", otherwise "may". This behavior
-was backported to Postfix versions 3.5.9, 3.4.19, 3.3.16. 3.2.21.
-With earlier Postfix versions the default setting was always "dane".
+The default setting is "dane" as of Postfix versions 3.6.17,
+3.7.13, 3.8.8, 3.9.2, and 3.10.0. With earlier versions the default
+was mistakenly dependent on the smtp_tls_security_level setting.
 .PP
 Though with "insecure" MX records an active attacker can
 compromise SMTP transport security by returning forged MX records,
@@ -13164,6 +13163,8 @@ Diffie\-Hellman (EECDH) key exchange.   As of Postfix 3.6, the value of
 this parameter is always ignored, and Postfix behaves as though the
 \fBauto\fR value (described below) was chosen.
 .PP
+This feature is not used as of Postfix 3.6. Do not specify.
+.PP
 The available choices are:
 .IP "\fBauto\fR"
 Use the most preferred curve that is
@@ -14167,6 +14168,65 @@ MinProtocol = TLSv1
 .ft R
 .in -4
 .PP
+Example: Custom OpenSSL group settings.
+.PP
+.nf
+.na
+.ft C
+main.cf:
+    tls_config_file = ${config_directory}/openssl.cnf
+    tls_config_name = postfix
+.fi
+.ad
+.ft R
+.PP
+.nf
+.na
+.ft C
+openssl.cnf:
+    postfix = postfix_settings
+.fi
+.ad
+.ft R
+.PP
+.nf
+.na
+.ft C
+    [postfix_settings]
+    ssl_conf = postfix_ssl_settings
+.fi
+.ad
+.ft R
+.PP
+.nf
+.na
+.ft C
+    [postfix_ssl_settings]
+    system_default = baseline_postfix_settings
+.fi
+.ad
+.ft R
+.PP
+.nf
+.na
+.ft C
+    [baseline_postfix_settings]
+    # New OpenSSL 3.5 syntax, for older releases consider
+    # the Postfix default:
+    #
+    # Groups = X25519:X448:prime256v1:secp384r1:secp521r1:ffdhe2048:ffdhe3072
+    #
+    Groups = *X25519MLKEM768 / *X25519:X448 / P\-256:P\-384
+.fi
+.ad
+.ft R
+.PP
+Caution: It is typically best to just use the default OpenSSL
+group settings, by setting "tls_config_file = none". Overly strict
+system\-wide TLS settings will conflict with Postfix's opportunistic
+TLS, where being less restrictive is better than downgrading to
+cleartext SMTP.
+.PP
 This feature is available in Postfix >= 3.9, 3.8.1, 3.7.6,
 3.6.10, and 3.5.20.
 .SH tls_config_name (default: empty)
@@ -14327,8 +14387,7 @@ Postfix >= 3.4. See \fBSSL_CTX_set_options\fR(3).
 This feature is available in Postfix 2.8 and later.
 .SH tls_eecdh_auto_curves (default: see "postconf \-d" output)
 The prioritized list of elliptic curves supported by the Postfix
-SMTP client and server.  These curves are used by the Postfix SMTP
-server when "smtpd_tls_eecdh_grade = auto".  The selected curves must be
+SMTP client and server. The selected curves must be
 implemented by OpenSSL and be standardized for use in TLS (RFC 8422).
 It is unwise to list only "bleeding\-edge" curves supported by a small
 subset of clients.  The default list is suitable for most users.
@@ -14346,6 +14405,13 @@ See also the "tls_ffdhe_auto_groups" parameter, which supports
 customizing the list of FFDHE groups enabled with TLS 1.3.  That setting
 is introduced with Postfix 3.8, when built against OpenSSL 3.0 or later.
 .PP
+Post\-quantum cryptography support: OpenSSL 3.5 introduces new
+configuration syntax that Postfix will not attempt to imitate.
+Instead, with Postfix 3.6.17, 3.7.13, 3.8.8, 3.9.2, and later, set
+both tls_eecdh_auto_curves and if available tls_ffdhe_auto_groups
+to the empty value, to enable algorithm selection through OpenSSL
+configuration. See tls_config_file for a configuration example.
+.PP
 This feature is available in Postfix 3.2 and later, when it is
 compiled and linked with OpenSSL 1.0.2 or later on platforms where
 EC algorithms have not been disabled by the vendor.
@@ -14363,6 +14429,8 @@ must support this curve for EECDH key exchange to take place.  It
 is unwise to choose only "bleeding\-edge" curves supported by only a
 small subset of clients.
 .PP
+This feature is not used as of Postfix 3.6. Do not specify.
+.PP
 The default "strong" curve is rated in NSA Suite
 B for information classified up to SECRET.
 .PP
@@ -14398,6 +14466,8 @@ client implementations must support this curve for EECDH key exchange
 to take place.  It is unwise to choose only "bleeding\-edge" curves
 supported by only a small subset of clients.
 .PP
+This feature is not used as of Postfix 3.6. Do not specify.
+.PP
 This default "ultra" curve is rated in NSA Suite
 B for information classified up to TOP SECRET.
 .PP
@@ -14452,10 +14522,15 @@ Whether FFDHE key agreement is enabled in TLS 1.2 and earlier depends
 on whether any of the "kDHE" ciphers are included in the cipherlist.
 .PP
 Conversely, setting "tls_eecdh_auto_curves" empty disables TLS 1.3
-EC key agreement in OpenSSL 3.0 and later.  Note that at least one of
-"tls_eecdh_auto_curves" and "tls_ffdhe_auto_groups" must be non\-empty,
-this is required by OpenSSL 3.0.  If both are inadvertently set empty,
-Postfix will fall back to the compiled\-in defaults.
+EC key agreement in OpenSSL 3.0 and later. If both are set empty,
+Postfix will fall back to OpenSSL preferences as described next.
+.PP
+Post\-quantum cryptography support: OpenSSL 3.5 introduces new
+configuration syntax that Postfix will not attempt to imitate.
+Instead, with Postfix 3.6.17, 3.7.13, 3.8.8, 3.9.2, and later, set
+both tls_eecdh_auto_curves and tls_ffdhe_auto_groups to the empty
+value, to enable algorithm selection through OpenSSL configuration.
+See tls_config_file for a configuration example.
 .PP
 All the default groups and EC curves should sufficiently strong
 to make "pruning" the defaults unwise.  At a minimum, "X25519" and
@@ -15088,7 +15163,7 @@ The Postfix \fBtlsproxy\fR(8) server security grade for ephemeral
 elliptic\-curve Diffie\-Hellman (EECDH) key exchange. See
 smtpd_tls_eecdh_grade for further details.
 .PP
-This feature is deprecated as of Postfix 3.9. Do not specify.
+This feature is not used as of Postfix 3.6. Do not specify.
 .PP
 This feature is available in Postfix 2.8 and later.
 .SH tlsproxy_tls_enable_rpk (default: $smtpd_tls_enable_rpk)
index 0145350cbd05ab52eb351610c916acf8b470ba11..b9dae703eb209bf7ccf8828babc022caad7251cc 100644 (file)
@@ -630,7 +630,7 @@ Request that the Postfix SMTP client connects using the
 SUBMISSIONS/SMTPS protocol instead of using the STARTTLS command.
 .PP
 Available in Postfix version 3.1 and later:
-.IP "\fBsmtp_tls_dane_insecure_mx_policy (see 'postconf -d' output)\fR"
+.IP "\fBsmtp_tls_dane_insecure_mx_policy (dane)\fR"
 The TLS policy for MX hosts with "secure" TLSA records when the
 nexthop destination security level is \fBdane\fR, but the MX
 record was found via an "insecure" MX lookup.
index d13719b4bca4072ae6806772b1d5b77a56a0dca5..023b1eef277d1d7d530aeff7a8ab441a90ade56f 100644 (file)
@@ -13262,8 +13262,7 @@ parameter. See there for details. </p>
 %PARAM tls_eecdh_auto_curves see "postconf -d" output
 
 <p> The prioritized list of elliptic curves supported by the Postfix
-SMTP client and server.  These curves are used by the Postfix SMTP
-server when "smtpd_tls_eecdh_grade = auto".  The selected curves must be
+SMTP client and server. The selected curves must be
 implemented by OpenSSL and be standardized for use in TLS (RFC 8422).
 It is unwise to list only "bleeding-edge" curves supported by a small
 subset of clients.  The default list is suitable for most users. </p>
@@ -13282,6 +13281,14 @@ customizing the list of FFDHE groups enabled with TLS 1.3.  That setting
 is introduced with Postfix 3.8, when built against OpenSSL 3.0 or later.
 </p>
 
+<p> Post-quantum cryptography support: OpenSSL 3.5 introduces new
+configuration syntax that Postfix will not attempt to imitate.
+Instead, with Postfix 3.6.17, 3.7.13, 3.8.8, 3.9.2, and later, set
+both tls_eecdh_auto_curves and if available tls_ffdhe_auto_groups
+to the empty value, to enable algorithm selection through OpenSSL
+configuration. See tls_config_file for a configuration example.
+</p>
+
 <p> This feature is available in Postfix 3.2 and later, when it is
 compiled and linked with OpenSSL 1.0.2 or later on platforms where
 EC algorithms have not been disabled by the vendor. </p>
@@ -13312,10 +13319,15 @@ on whether any of the "kDHE" ciphers are included in the cipherlist.
 </p>
 
 <p> Conversely, setting "tls_eecdh_auto_curves" empty disables TLS 1.3
-EC key agreement in OpenSSL 3.0 and later.  Note that at least one of
-"tls_eecdh_auto_curves" and "tls_ffdhe_auto_groups" must be non-empty,
-this is required by OpenSSL 3.0.  If both are inadvertently set empty,
-Postfix will fall back to the compiled-in defaults. </p>
+EC key agreement in OpenSSL 3.0 and later. If both are set empty,
+Postfix will fall back to OpenSSL preferences as described next. </p>
+
+<p> Post-quantum cryptography support: OpenSSL 3.5 introduces new
+configuration syntax that Postfix will not attempt to imitate.
+Instead, with Postfix 3.6.17, 3.7.13, 3.8.8, 3.9.2, and later, set
+both tls_eecdh_auto_curves and tls_ffdhe_auto_groups to the empty
+value, to enable algorithm selection through OpenSSL configuration.
+See tls_config_file for a configuration example. </p>
 
 <p> All the default groups and EC curves should sufficiently strong
 to make "pruning" the defaults unwise.  At a minimum, "X25519" and
@@ -13340,6 +13352,8 @@ must support this curve for EECDH key exchange to take place.  It
 is unwise to choose only "bleeding-edge" curves supported by only a
 small subset of clients.  </p>
 
+<p> This feature is not used as of Postfix 3.6. Do not specify. </p>
+
 <p> The default "strong" curve is rated in NSA <a
 href="https://web.archive.org/web/20160330034144/https://www.nsa.gov/ia/programs/suiteb_cryptography/">Suite
 B</a> for information classified up to SECRET.  </p>
@@ -13380,6 +13394,8 @@ client implementations must support this curve for EECDH key exchange
 to take place.  It is unwise to choose only "bleeding-edge" curves
 supported by only a small subset of clients. </p>
 
+<p> This feature is not used as of Postfix 3.6. Do not specify. </p>
+
 <p> This default "ultra" curve is rated in NSA <a
 href="https://web.archive.org/web/20160330034144/https://www.nsa.gov/ia/programs/suiteb_cryptography/">Suite
 B</a> for information classified up to TOP SECRET. </p>
@@ -13406,6 +13422,8 @@ this parameter is always ignored, and Postfix behaves as though the
 <b>auto</b> value (described below) was chosen.
 </p>
 
+<p> This feature is not used as of Postfix 3.6. Do not specify. </p>
+
 <p> The available choices are: </p>
 
 <dl>
@@ -15881,7 +15899,7 @@ the "tlsproxy_tls_chain_files" parameter. </p>
 elliptic-curve Diffie-Hellman (EECDH) key exchange. See
 smtpd_tls_eecdh_grade for further details. </p>
 
-<p> This feature is deprecated as of Postfix 3.9. Do not specify. </p>
+<p> This feature is not used as of Postfix 3.6. Do not specify. </p>
 
 <p> This feature is available in Postfix 2.8 and later. </p>
 
@@ -17490,7 +17508,7 @@ clients).  </p>
 This feature is available in Postfix 3.1 and later.
 </p>
 
-%PARAM smtp_tls_dane_insecure_mx_policy see "postconf -d" output
+%PARAM smtp_tls_dane_insecure_mx_policy dane
 
 <p> The TLS policy for MX hosts with "secure" TLSA records when the
 nexthop destination security level is <b>dane</b>, but the MX
@@ -17514,10 +17532,9 @@ authentication succeeds, it will be logged only as "Trusted", not
 "Verified", because the MX host name could have been forged.  </dd>
 </dl>
 
-<p> The default setting for Postfix &ge; 3.6 is "dane" with
-"smtp_tls_security_level = dane", otherwise "may". This behavior
-was backported to Postfix versions 3.5.9, 3.4.19, 3.3.16. 3.2.21.
-With earlier Postfix versions the default setting was always "dane".
+<p> The default setting is "dane" as of Postfix versions 3.6.17,
+3.7.13, 3.8.8, 3.9.2, and 3.10.0. With earlier versions the default
+was mistakenly dependent on the smtp_tls_security_level setting.
 </p>
 
 <p> Though with "insecure" MX records an active attacker can
@@ -19087,6 +19104,45 @@ MinProtocol = TLSv1
 </pre>
 </blockquote>
 
+<p> Example: Custom OpenSSL group settings. </p>
+
+<pre>
+main.cf:
+    tls_config_file = ${config_directory}/openssl.cnf
+    tls_config_name = postfix
+</pre>
+
+<pre>
+openssl.cnf:
+    postfix = postfix_settings
+</pre>
+
+<pre>
+    [postfix_settings]
+    ssl_conf = postfix_ssl_settings
+</pre>
+
+<pre>
+    [postfix_ssl_settings]
+    system_default = baseline_postfix_settings
+</pre>
+
+<pre>
+    [baseline_postfix_settings]
+    # New OpenSSL 3.5 syntax, for older releases consider
+    # the Postfix default:
+    #
+    # Groups = X25519:X448:prime256v1:secp384r1:secp521r1:ffdhe2048:ffdhe3072
+    #
+    Groups = *X25519MLKEM768 / *X25519:X448 / P-256:P-384
+</pre>
+
+<p> Caution: It is typically best to just use the default OpenSSL
+group settings, by setting "tls_config_file = none". Overly strict
+system-wide TLS settings will conflict with Postfix's opportunistic
+TLS, where being less restrictive is better than downgrading to
+cleartext SMTP. </p>
+
 <p> This feature is available in Postfix &ge; 3.9, 3.8.1, 3.7.6,
 3.6.10, and 3.5.20. </p>
 
index 2482359545e1f0240425f7cbe2f4b9fdec54fbf0..d063b9ab3f8340ac51478c2dcd9c76223e32b768 100644 (file)
@@ -356,7 +356,8 @@ static BOUNCE_INFO *bounce_mail_alloc(const char *service,
                quote_822_local_flags(bounce_info->sender,
                                      VSTRING_LEN(bounce_info->buf) ?
                                      STR(bounce_info->buf) :
-                                     mail_addr_mail_daemon(), 0);
+                                     mail_addr_mail_daemon(),
+                                     QUOTE_FLAG_8BITCLEAN);
            }
 
            /*
index d5b12711057370b6e92d08ea53c40ed3c4b68c5e..c7960894645bef7b8b4c2f4a6cb9921c6dda3590 100644 (file)
@@ -779,7 +779,7 @@ static void cleanup_header_done_callback(void *context)
                }
                if (token) {
                    tok822_externalize(state->temp2, token, TOK822_STR_NONE);
-                   tok822_free(token);
+                   tok822_free_tree(token);
                    vstring_strcat(state->temp2, " ");
                }
                vstring_sprintf_append(state->temp2, "<%s>",
index 133cc0d4425308630d7dacfb134c398155c35440..58aeaaf0c8ca18f1522a7616df194647aa0fd31f 100644 (file)
@@ -733,6 +733,9 @@ static void mysql_parse_config(DICT_MYSQL *dict_mysql, const char *mysqlcf)
            msg_info("%s: %s: no hostnames specified, defaulting to '%s'",
                     myname, mysqlcf, dict_mysql->hosts->argv[0]);
     }
+    /* Don't blacklist the load balancer! */
+    if (dict_mysql->hosts->argc == 1)
+        argv_add(dict_mysql->hosts, dict_mysql->hosts->argv[0], (char *) 0);
     myfree(hosts);
 }
 
index c62685451d51a43c76819723b94f9a61b571294c..89cb59f070da202bbadcd3f71d88b68247d17c02 100644 (file)
@@ -687,6 +687,9 @@ static void pgsql_parse_config(DICT_PGSQL *dict_pgsql, const char *pgsqlcf)
            msg_info("%s: %s: no hostnames specified, defaulting to '%s'",
                     myname, pgsqlcf, dict_pgsql->hosts->argv[0]);
     }
+    /* Don't blacklist the load balancer! */
+    if (dict_pgsql->hosts->argc == 1)
+       argv_add(dict_pgsql->hosts, dict_pgsql->hosts->argv[0], (char *) 0);
     myfree(hosts);
 }
 
index 1f03b0b34e7db79dc42f7557b701864ccbee0d0c..e91f4c57df8a5105073d7efb3ea141ebbfafa920 100644 (file)
@@ -1660,7 +1660,7 @@ extern bool var_smtp_tls_force_tlsa;
 
  /* SMTP only */
 #define VAR_SMTP_TLS_INSECURE_MX_POLICY "smtp_tls_dane_insecure_mx_policy"
-#define DEF_SMTP_TLS_INSECURE_MX_POLICY "${{$smtp_tls_security_level} == {dane} ? {dane} : {may}}"
+#define DEF_SMTP_TLS_INSECURE_MX_POLICY "dane"
 extern char *var_smtp_tls_insecure_mx_policy;
 
  /*
index bbd5d21ef38b9b27329d2d93147678a2f68c5e3a..44f1c9d1a3727ab25423e2251e690cda9c538d5b 100644 (file)
@@ -20,8 +20,8 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20241204"
-#define MAIL_VERSION_NUMBER    "3.9.1"
+#define MAIL_RELEASE_DATE      "20250216"
+#define MAIL_VERSION_NUMBER    "3.9.2"
 
 #ifdef SNAPSHOT
 #define MAIL_VERSION_DATE      "-" MAIL_RELEASE_DATE
index 95d658356c8c1b342437feeb6a03a3c2a16f8883..91f0b8ec9c64379f12c79444a0e8d35523b1c7f9 100644 (file)
@@ -99,6 +99,11 @@ extern int smtputf8_autodetect(int);
 #define SMTPUTF8_FLAG_SENDER   (1<<2)  /* queue file/delivery/bounce request */
 #define SMTPUTF8_FLAG_RECIPIENT        (1<<3)  /* delivery request only */
 
+#define SMTPUTF8_FLAG_ALL      (SMTPUTF8_FLAG_REQUESTED \
+                               | SMTPUTF8_FLAG_HEADER \
+                               | SMTPUTF8_FLAG_SENDER \
+                               | SMTPUTF8_FLAG_RECIPIENT)
+
 /* LICENSE
 /* .ad
 /* .fi
index 593042b2833394eb6dff4fc6b04bac0f5e59b0a6..ab841d13efda0a02e798436626edcb72e56bf97c 100644 (file)
@@ -285,6 +285,7 @@ qmgr_message.o: ../../include/resolve_clnt.h
 qmgr_message.o: ../../include/rewrite_clnt.h
 qmgr_message.o: ../../include/scan_dir.h
 qmgr_message.o: ../../include/sent.h
+qmgr_message.o: ../../include/smtputf8.h
 qmgr_message.o: ../../include/split_addr.h
 qmgr_message.o: ../../include/split_at.h
 qmgr_message.o: ../../include/stringops.h
index b885264a20d049c125b3700ea663868ac104b44f..fda3ee55fd7f1adb605b6ecf60b08b35f6b2dae1 100644 (file)
 #include <split_addr.h>
 #include <dsn_mask.h>
 #include <rec_attr_map.h>
+#include <smtputf8.h>
 
 /* Client stubs. */
 
@@ -562,6 +563,8 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
                        rec_type = REC_TYPE_ERROR;
                        break;
                    }
+                   /* Forward compatibility. */
+                   message->smtputf8 &= SMTPUTF8_FLAG_ALL;
                } else if (count == 1) {
                    /* Postfix < 1.0 (a.k.a. 20010228). */
                    qmgr_message_oldstyle_scan(message);
index 79d92b2f3ca3c54bccd62e7f052e82c87d1da432..935b7ff2137afee21c49ce0c11be3d6a79fb057c 100644 (file)
@@ -301,6 +301,7 @@ qmgr_message.o: ../../include/rewrite_clnt.h
 qmgr_message.o: ../../include/sane_time.h
 qmgr_message.o: ../../include/scan_dir.h
 qmgr_message.o: ../../include/sent.h
+qmgr_message.o: ../../include/smtputf8.h
 qmgr_message.o: ../../include/split_addr.h
 qmgr_message.o: ../../include/split_at.h
 qmgr_message.o: ../../include/stringops.h
index 79143f3d3edbea5dfb813c6aa728a0ee198c33a4..9ae9cdd55824072db6557b1604e49c9e0180cec1 100644 (file)
 #include <split_addr.h>
 #include <dsn_mask.h>
 #include <rec_attr_map.h>
+#include <smtputf8.h>
 
 /* Client stubs. */
 
@@ -603,6 +604,8 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
                        rec_type = REC_TYPE_ERROR;
                        break;
                    }
+                   /* Forward compatibility. */
+                   message->smtputf8 &= SMTPUTF8_FLAG_ALL;
                } else if (count == 1) {
                    /* Postfix < 1.0 (a.k.a. 20010228). */
                    qmgr_message_oldstyle_scan(message);
index 51b2e6dba67aa0b70d2788523b0a1b13d63ee83a..ad0d9be045afbe2aaeccec547ca5d7f05c33ee12 100644 (file)
 /*     SUBMISSIONS/SMTPS protocol instead of using the STARTTLS command.
 /* .PP
 /*     Available in Postfix version 3.1 and later:
-/* .IP "\fBsmtp_tls_dane_insecure_mx_policy (see 'postconf -d' output)\fR"
+/* .IP "\fBsmtp_tls_dane_insecure_mx_policy (dane)\fR"
 /*     The TLS policy for MX hosts with "secure" TLSA records when the
 /*     nexthop destination security level is \fBdane\fR, but the MX
 /*     record was found via an "insecure" MX lookup.
index f47b954617271c5adbcb93086e8708da4573583a..d5add756345f0693472197e453c12fdff942b5a0 100644 (file)
@@ -385,7 +385,6 @@ static int setup_auto_groups(SSL_CTX *ctx, const char *origin,
 
 void    tls_auto_groups(SSL_CTX *ctx, const char *eecdh, const char *ffdhe)
 {
-#ifndef OPENSSL_NO_ECDH
     char   *def_eecdh = DEF_TLS_EECDH_AUTO;
 
 #if OPENSSL_VERSION_PREREQ(3, 0)
@@ -399,6 +398,10 @@ void    tls_auto_groups(SSL_CTX *ctx, const char *eecdh, const char *ffdhe)
 #endif
     const char *origin;
 
+    /* Use OpenSSL defaults */
+    if (!*eecdh && !*ffdhe)
+        return;
+
     /*
      * Try the user-specified list first. If that fails (empty list or no
      * known group name), try again with the Postfix defaults. We assume that
@@ -424,7 +427,6 @@ void    tls_auto_groups(SSL_CTX *ctx, const char *eecdh, const char *ffdhe)
            return;
        }
     }
-#endif
 }
 
 #ifdef TEST
index cf8f6fa709008b20c06a16b0740c1613e6fb12c4..8a46c947d35a0e62ec8758892bc461aef0b4ead1 100644 (file)
@@ -674,8 +674,8 @@ void    tls_param_init(void)
        VAR_TLS_EXPORT_CLIST, DEF_TLS_EXPORT_CLIST, &var_tls_export_ignored, 0, 0,
        VAR_TLS_NULL_CLIST, DEF_TLS_NULL_CLIST, &var_tls_null_clist, 1, 0,
        VAR_TLS_EECDH_AUTO, DEF_TLS_EECDH_AUTO, &var_tls_eecdh_auto, 0, 0,
-       VAR_TLS_EECDH_STRONG, DEF_TLS_EECDH_STRONG, &var_tls_eecdh_strong, 1, 0,
-       VAR_TLS_EECDH_ULTRA, DEF_TLS_EECDH_ULTRA, &var_tls_eecdh_ultra, 1, 0,
+       VAR_TLS_EECDH_STRONG, DEF_TLS_EECDH_STRONG, &var_tls_eecdh_strong, 0, 0,
+       VAR_TLS_EECDH_ULTRA, DEF_TLS_EECDH_ULTRA, &var_tls_eecdh_ultra, 0, 0,
        VAR_TLS_FFDHE_AUTO, DEF_TLS_FFDHE_AUTO, &var_tls_ffdhe_auto, 0, 0,
        VAR_TLS_BUG_TWEAKS, DEF_TLS_BUG_TWEAKS, &var_tls_bug_tweaks, 0, 0,
        VAR_TLS_SSL_OPTIONS, DEF_TLS_SSL_OPTIONS, &var_tls_ssl_options, 0, 0,
@@ -1057,6 +1057,12 @@ void    tls_get_signature_params(TLS_SESS_STATE *TLScontext)
            kex_name = OBJ_nid2sn(EVP_PKEY_type(nid));
            break;
 
+#if defined(EVP_PKEY_KEYMGMT)
+       case EVP_PKEY_KEYMGMT:
+           kex_name = EVP_PKEY_get0_type_name(dh_pkey);
+           break;
+#endif
+
        case EVP_PKEY_DH:
            kex_name = "DHE";
            TLScontext->kex_bits = EVP_PKEY_bits(dh_pkey);
@@ -1069,8 +1075,17 @@ void    tls_get_signature_params(TLS_SESS_STATE *TLScontext)
            break;
 #endif
        }
-       EVP_PKEY_free(dh_pkey);
     }
+    if (kex_name) {
+       TLScontext->kex_name = mystrdup(kex_name);
+       TLScontext->kex_curve = kex_curve;
+    }
+    /* Not a problem if NULL */
+    EVP_PKEY_free(dh_pkey);
+
+    /* Resumption makes no use of signature keys or digests */
+    if (TLScontext->session_reused)
+       return;
 
     /*
      * On the client end, the certificate may be present, but not used, so we
@@ -1096,11 +1111,18 @@ void    tls_get_signature_params(TLS_SESS_STATE *TLScontext)
         * the more familiar name.  For "RSA" keys report "RSA-PSS", which
         * must be used with TLS 1.3.
         */
-       if ((nid = EVP_PKEY_type(EVP_PKEY_id(local_pkey))) != NID_undef) {
+       if ((nid = EVP_PKEY_id(local_pkey)) != NID_undef) {
            switch (nid) {
            default:
-               locl_sig_name = OBJ_nid2sn(nid);
+               if ((nid = EVP_PKEY_type(nid)) != NID_undef)
+                   locl_sig_name = OBJ_nid2sn(nid);
+               break;
+
+#if defined(EVP_PKEY_KEYMGMT)
+           case EVP_PKEY_KEYMGMT:
+               locl_sig_name = EVP_PKEY_get0_type_name(local_pkey);
                break;
+#endif
 
            case EVP_PKEY_RSA:
                /* For RSA, TLS 1.3 mandates PSS signatures */
@@ -1123,6 +1145,13 @@ void    tls_get_signature_params(TLS_SESS_STATE *TLScontext)
         */
        if (SSL_get_signature_nid(ssl, &nid) && nid != NID_undef)
            locl_sig_dgst = OBJ_nid2sn(nid);
+
+       if (locl_sig_name) {
+           SIG_PROP(TLScontext, srvr, name) = mystrdup(locl_sig_name);
+           SIG_PROP(TLScontext, srvr, curve) = locl_sig_curve;
+           if (locl_sig_dgst)
+               SIG_PROP(TLScontext, srvr, dgst) = mystrdup(locl_sig_dgst);
+       }
     }
     peer_cert = TLS_PEEK_PEER_CERT(ssl);
     if (peer_cert != 0) {
@@ -1150,11 +1179,18 @@ void    tls_get_signature_params(TLS_SESS_STATE *TLScontext)
         * the more familiar name.  For "RSA" keys report "RSA-PSS", which
         * must be used with TLS 1.3.
         */
-       if ((nid = EVP_PKEY_type(EVP_PKEY_id(peer_pkey))) != NID_undef) {
+       if ((nid = EVP_PKEY_id(peer_pkey)) != NID_undef) {
            switch (nid) {
            default:
-               peer_sig_name = OBJ_nid2sn(nid);
+               if ((nid = EVP_PKEY_type(nid)) != NID_undef)
+                   peer_sig_name = OBJ_nid2sn(nid);
+               break;
+
+#if defined(EVP_PKEY_KEYMGMT)
+           case EVP_PKEY_KEYMGMT:
+               peer_sig_name = EVP_PKEY_get0_type_name(peer_pkey);
                break;
+#endif
 
            case EVP_PKEY_RSA:
                /* For RSA, TLS 1.3 mandates PSS signatures */
@@ -1178,25 +1214,14 @@ void    tls_get_signature_params(TLS_SESS_STATE *TLScontext)
        if (SSL_get_peer_signature_nid(ssl, &nid) && nid != NID_undef)
            peer_sig_dgst = OBJ_nid2sn(nid);
 
+       if (peer_sig_name) {
+           SIG_PROP(TLScontext, !srvr, name) = mystrdup(peer_sig_name);
+           SIG_PROP(TLScontext, !srvr, curve) = peer_sig_curve;
+           if (peer_sig_dgst)
+               SIG_PROP(TLScontext, !srvr, dgst) = mystrdup(peer_sig_dgst);
+       }
     }
     TLS_FREE_PEER_CERT(peer_cert);
-
-    if (kex_name) {
-       TLScontext->kex_name = mystrdup(kex_name);
-       TLScontext->kex_curve = kex_curve;
-    }
-    if (locl_sig_name) {
-       SIG_PROP(TLScontext, srvr, name) = mystrdup(locl_sig_name);
-       SIG_PROP(TLScontext, srvr, curve) = locl_sig_curve;
-       if (locl_sig_dgst)
-           SIG_PROP(TLScontext, srvr, dgst) = mystrdup(locl_sig_dgst);
-    }
-    if (peer_sig_name) {
-       SIG_PROP(TLScontext, !srvr, name) = mystrdup(peer_sig_name);
-       SIG_PROP(TLScontext, !srvr, curve) = peer_sig_curve;
-       if (peer_sig_dgst)
-           SIG_PROP(TLScontext, !srvr, dgst) = mystrdup(peer_sig_dgst);
-    }
 }
 
 /* tls_log_summary - TLS loglevel 1 one-liner, embellished with TLS 1.3 details */
index e9480a2d6532b4e5784189d189bd434af869230c..420a92b0505b3d134ab470c9b83227ee91e1ad3e 100644 (file)
@@ -39,6 +39,9 @@
 
 #include <sys_defs.h>
 #include <sys/ioctl.h>
+#ifdef SUNOS5
+#include <sys/socket.h>                        /* shutdown(2) */
+#endif
 #ifdef FIONREAD_IN_SYS_FILIO_H
 #include <sys/filio.h>
 #endif