]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.12-20260716
authorWietse Z Venema <wietse@porcupine.org>
Thu, 16 Jul 2026 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <ietf-dane@dukhovni.org>
Wed, 22 Jul 2026 14:33:53 +0000 (00:33 +1000)
29 files changed:
postfix/HISTORY
postfix/README_FILES/MILTER_README
postfix/README_FILES/SMTPD_POLICY_README
postfix/html/MILTER_README.html
postfix/html/SMTPD_POLICY_README.html
postfix/html/postconf.5.html
postfix/html/socketmap_table.5.html
postfix/man/man5/postconf.5
postfix/man/man5/socketmap_table.5
postfix/mantools/postlink
postfix/proto/MILTER_README.html
postfix/proto/SMTPD_POLICY_README.html
postfix/proto/postconf.proto
postfix/proto/socketmap_table
postfix/proto/stop
postfix/src/global/mail_params.c
postfix/src/global/mail_params.h
postfix/src/global/mail_proto.h
postfix/src/global/mail_version.h
postfix/src/milter/milter.h
postfix/src/milter/test-milter.c
postfix/src/posttls-finger/posttls-finger.c
postfix/src/smtpd/smtpd_check.c
postfix/src/smtpd/smtpd_milter.c
postfix/src/tls/tls_server.c
postfix/src/util/dict_nisplus.c
postfix/src/util/dict_sockmap.c
postfix/src/util/dict_sockmap.h
postfix/src/util/nbbio.c

index 7318d3cfcc36dd599c594832cc6c7a76f74a0d3e..a044aa6060ee34990bdb18407df5bc7820868f27 100644 (file)
@@ -31724,6 +31724,28 @@ Apologies for any names omitted.
        added proper unit tests. Files: myflock.[hc], myflock_test.c,
        wrap_fcntl.[hc], mock_fcntl.[hc].
 
+20260716
+
+       Feature: support for the "tls_sni" attribute in the SMTP
+       server policy delegation protocol, and for the "{tls_sni}"
+       macro in the Milter protocol. This also corrects a MILTER_README
+       table with macro availability (TLS-related macros are not
+       available in the EOH and EOM Milter protocol stages).
+       Contributed by Steve Short (fortra.com). Files:
+       MILTER_README.html, SMTPD_POLICY_README.html, mail_proto.h,
+       milter.h, test-milter.c, smtpd_check.c, smtpd_milter.c.
+
+       Cleanup: removed unused variables. Viktor Dukhovni. Files:
+       posttls-finger.c, tls_server.c.
+
+       Typofixes. Files: proto/stop, nbbio.c, dict_nisplus.c.
+
+       Feature: socketmap_max_query_size (default: 10000) limits
+       the length in bytes for a socketmap search key. A request
+       that exceeds the limit produces a warning and a 'not found'
+       result. Files: postlink, socketmap_table, dict_sockmap.[hc],
+       global/mail_params.[hc].
+
 TODO
 
        Reorganize PTEST_LIB, PMOCK_LIB, TESTLIB, TESTLIBS, etc.
index aafc693964d4905c5651fc669ffe9ab02f68e6bf..b2ad8efe8352653520bb6934fc62b4ed6a88f8ba 100644 (file)
@@ -456,17 +456,15 @@ Sendmail. See the workarounds section below for solutions.
     |                    |                         |When address -> name      |
     |                    |                         |lookup fails: "unknown"   |
     |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
-    |{cert_issuer}       |HELO, MAIL, DATA, EOH,   |TLS client certificate    |
-    |                    |EOM                      |issuer                    |
+    |{cert_issuer}       |HELO, MAIL, DATA         |TLS client certificate    |
+    |                    |                         |issuer                    |
     |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
-    |{cert_subject}      |HELO, MAIL, DATA, EOH,   |TLS client certificate    |
-    |                    |EOM                      |subject                   |
+    |{cert_subject}      |HELO, MAIL, DATA         |TLS client certificate    |
+    |                    |                         |subject                   |
     |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
-    |{cipher_bits}       |HELO, MAIL, DATA, EOH,   |TLS session key size      |
-    |                    |EOM                      |                          |
+    |{cipher_bits}       |HELO, MAIL, DATA         |TLS session key size      |
     |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
-    |{cipher}            |HELO, MAIL, DATA, EOH,   |TLS cipher                |
-    |                    |EOM                      |                          |
+    |{cipher}            |HELO, MAIL, DATA         |TLS cipher                |
     |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
     |{daemon_addr}       |Always (Postfix >=3.2)   |Local server IP address   |
     |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
@@ -497,8 +495,10 @@ Sendmail. See the workarounds section below for solutions.
     |                    |only with smtpd_milters) |With rejected recipient:  |
     |                    |                         |"error"                   |
     |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
-    |{tls_version}       |HELO, MAIL, DATA, EOH,   |TLS protocol version      |
-    |                    |EOM                      |                          |
+    |{tls_sni}           |HELO, MAIL, DATA (Postfix|TLS server name indication|
+    |                    |>=3.12)                  |                          |
+    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
+    |{tls_version}       |HELO, MAIL, DATA         |TLS protocol version      |
     |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
     |v                   |Always                   |value of milter_macro_v   |
     |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
index 63f6cb74c01a6f7689ae88c399e63a9a098c39ce..57c074a117ad172b13454d1c3a139560b625dc67 100644 (file)
@@ -88,6 +88,8 @@ a delegated SMTPD access policy request:
     P\bPo\bos\bst\btf\bfi\bix\bx v\bve\ber\brs\bsi\bio\bon\bn 3\b3.\b.8\b8 a\ban\bnd\bd l\bla\bat\bte\ber\br:\b:
     compatibility_level=major.minor.patch
     mail_version=3.8.0
+    P\bPo\bos\bst\btf\bfi\bix\bx v\bve\ber\brs\bsi\bio\bon\bn 3\b3.\b.1\b12\b2 a\ban\bnd\bd l\bla\bat\bte\ber\br:\b:
+    tls_sni=mail.example.com
     [empty line]
 
 Notes:
@@ -158,6 +160,11 @@ Notes:
     about how the connection is encrypted. With plaintext connections the
     protocol and cipher attributes are empty and the keysize is zero.
 
+  * The "tls_sni" attribute (Postfix 3.12 and later) specifies the server name
+    indication that the remote SMTP client sent in the TLS handshake. This
+    attribute is empty for plaintext connections and when the remote SMTP
+    client sends no SNI.
+
   * The "etrn_domain" attribute is defined only in the context of the ETRN
     command, and specifies the ETRN command parameter.
 
index 8415840261d028f93a94c234fca5ae74c0be68d9..4aa9cb31e9f38aa8c7cc74df5595b072e886cb5d 100644 (file)
@@ -704,16 +704,16 @@ verification fails: "unknown" </td> </tr>
 <td> Client name from address &rarr; name lookup <br> When address
 &rarr; name lookup fails: "unknown" </td> </tr>
 
-<tr> <td> {cert_issuer} </td> <td> HELO, MAIL, DATA, EOH, EOM </td> <td>
+<tr> <td> {cert_issuer} </td> <td> HELO, MAIL, DATA </td> <td>
 TLS client certificate issuer </td> </tr>
 
-<tr> <td> {cert_subject} </td> <td> HELO, MAIL, DATA, EOH, EOM </td>
+<tr> <td> {cert_subject} </td> <td> HELO, MAIL, DATA </td>
 <td> TLS client certificate subject </td> </tr>
 
-<tr> <td> {cipher_bits} </td> <td> HELO, MAIL, DATA, EOH, EOM </td> <td>
+<tr> <td> {cipher_bits} </td> <td> HELO, MAIL, DATA </td> <td>
 TLS session key size </td> </tr>
 
-<tr> <td> {cipher} </td> <td> HELO, MAIL, DATA, EOH, EOM </td> <td> TLS
+<tr> <td> {cipher} </td> <td> HELO, MAIL, DATA </td> <td> TLS
 cipher </td> </tr>
 
 <tr> <td> {daemon_addr} </td> <td> Always (Postfix &ge;3.2) </td>
@@ -745,7 +745,10 @@ rejected recipient: enhanced status code </td> </tr>
 <a href="postconf.5.html#smtpd_milters">smtpd_milters</a>) </td> <td> Recipient mail delivery transport <br>
 With rejected recipient: "error" </td> </tr>
 
-<tr> <td> {tls_version} </td> <td> HELO, MAIL, DATA, EOH, EOM </td>
+<tr> <td> {tls_sni} </td> <td> HELO, MAIL, DATA (Postfix &ge;3.12)
+</td> <td> TLS server name indication </td> </tr>
+
+<tr> <td> {tls_version} </td> <td> HELO, MAIL, DATA </td>
 <td> TLS protocol version </td> </tr>
 
 <tr> <td> v </td> <td> Always </td> <td> value of <a href="postconf.5.html#milter_macro_v">milter_macro_v</a>
index 1202b1dec52f6f8f40a35e9814cebb8d1635c05c..39abee1238309bcfd0276dacd11efb8c0632ca0d 100644 (file)
@@ -120,6 +120,8 @@ server_port=54321
 <b>Postfix version 3.8 and later:</b>
 <a href="postconf.5.html#compatibility_level">compatibility_level</a>=<i>major</i>.<i>minor</i>.<i>patch</i>
 <a href="postconf.5.html#mail_version">mail_version</a>=3.8.0
+<b>Postfix version 3.12 and later:</b>
+tls_sni=mail.example.com
 [empty line]
 </pre>
 </blockquote>
@@ -206,6 +208,11 @@ server_port=54321
     plaintext connections the protocol and cipher attributes are
     empty and the keysize is zero.  </p>
 
+    <li> <p> The "tls_sni" attribute (Postfix 3.12 and later)
+    specifies the server name indication that the remote SMTP client
+    sent in the TLS handshake. This attribute is empty for plaintext
+    connections and when the remote SMTP client sends no SNI. </p>
+
     <li> <p> The "etrn_domain" attribute is defined only in the
     context of the ETRN command, and specifies the ETRN command
     parameter. </p>
index c71d032601fc87cddfd783d21c583a2a1cf4e33a..7fc52ce1c97aa39c165d2e17dc0272d26afa9d0f 100644 (file)
@@ -21217,6 +21217,19 @@ built to support these protocols. </p>
 <p> This feature is available in Postfix 3.0 and later. </p>
 
 
+</DD>
+
+<DT><b><a name="socketmap_max_query_size">socketmap_max_query_size</a>
+(default: 10000)</b></DT><DD>
+
+<p> The maximum allowed query size for a socketmap client, not
+including the socketmap and netstring encapsulation. A request that
+exceeds the limit generates a warning and a 'not found' result.
+</p>
+
+<p> This feature is available in Postfix &ge; 3.12. </p>
+
+
 </DD>
 
 <DT><b><a name="socketmap_max_reply_size">socketmap_max_reply_size</a>
index d38de3640ed63a9386369c1a393f319cbaf7ed53..b4e431971f6164406902d81f6b2acb0bdcf82bd1 100644 (file)
@@ -68,18 +68,23 @@ SOCKETMAP_TABLE(5)                                          SOCKETMAP_TABLE(5)
        can be changed with the <a href="postconf.5.html#socketmap_max_reply_size">socketmap_max_reply_size</a> configuration  parame-
        ter (Postfix 3.10 and later).
 
+       The  Postfix  socketmap client requires that queries are no longer than
+       10000 bytes (not including the netstring encapsulation). This limit can
+       be  changed  with  the <a href="postconf.5.html#socketmap_max_query_size">socketmap_max_query_size</a> configuration parameter
+       (Postfix 3.12 and later).
+
        The Postfix socketmap client enforces a 100s time limit to connect to a
-       socketmap server, to send a request, and to receive a reply. It  closes
-       an  idle  connection  after  10s, and closes an active connection after
+       socketmap  server, to send a request, and to receive a reply. It closes
+       an idle connection after 10s, and closes  an  active  connection  after
        100s. These limits are not (yet) configurable.
 
 <b><a name="security">SECURITY</a></b>
-       This map cannot be used  for  security-sensitive  information,  because
+       This  map  cannot  be  used for security-sensitive information, because
        neither the connection nor the server are authenticated.
 
 <b><a name="configuration_parameters">CONFIGURATION PARAMETERS</a></b>
        <b><a href="postconf.5.html#socketmap_max_reply_size">socketmap_max_reply_size</a> (100000)</b>
-              The  maximum  allowed  reply  size  from a socketmap server, not
+              The maximum allowed reply size  from  a  socketmap  server,  not
               including the netstring encapsulation.
 
 <b><a name="see_also">SEE ALSO</a></b>
index a5a7a28a4a41e5c64e68e7cf69bcbfaf760bd431..6ccde017c47042bd5656822eedbe940a5c44906a 100644 (file)
@@ -14931,6 +14931,12 @@ in RFC 6531, RFC 6532, and RFC 6533. This requires that Postfix is
 built to support these protocols.
 .PP
 This feature is available in Postfix 3.0 and later.
+.SH socketmap_max_query_size (default: 10000)
+The maximum allowed query size for a socketmap client, not
+including the socketmap and netstring encapsulation. A request that
+exceeds the limit generates a warning and a 'not found' result.
+.PP
+This feature is available in Postfix >= 3.12.
 .SH socketmap_max_reply_size (default: 100000)
 The maximum allowed reply size from a socketmap server, not
 including the netstring encapsulation.
index 620d20f5310dc1ed98c581d14f687b043f50f79e..0e065b20047fb1097d626e254d332dbd1775772b 100644 (file)
@@ -78,6 +78,11 @@ encapsulation). This limit can be changed with the
 socketmap_max_reply_size configuration parameter (Postfix 3.10
 and later).
 
+The Postfix socketmap client requires that queries are no longer
+than 10000 bytes (not including the netstring encapsulation). This
+limit can be changed with the socketmap_max_query_size
+configuration parameter (Postfix 3.12 and later).
+
 The Postfix socketmap client enforces a 100s time limit to
 connect to a socketmap server, to send a request, and to receive
 a reply. It closes an idle connection after 10s, and closes
index 064684fa6895366e4d044d8bf03dd720a867e5f3..12979a79e2a577646bf2d374d4bb81f11ff99f86 100755 (executable)
@@ -409,6 +409,7 @@ while (<>) {
     s;\bservice_name\b;<a href="postconf.5.html#service_name">$&</a>;g;
 
     s;\bsocket[-</Bb>]*\n* *[<Bb>]*map_max_reply_size\b;<a href="postconf.5.html#socketmap_max_reply_size">$&</a>;g;
+    s;\bsocket[-</Bb>]*\n* *[<Bb>]*map_max_query_size\b;<a href="postconf.5.html#socketmap_max_query_size">$&</a>;g;
     s;\bdefault_desti[-</Bb>]*\n* *[<Bb>]*na[-</Bb>]*\n* *[<Bb>]*tion_con[-</Bb>]*\n* *[<Bb>]*cur[-</Bb>]*\n* *[<Bb>]*rency_negative_feedback\b;<a href="postconf.5.html#default_destination_concurrency_negative_feedback">$&</a>;g;
     s;\bdefault_desti[-</Bb>]*\n* *[<Bb>]*na[-</Bb>]*\n* *[<Bb>]*tion_con[-</Bb>]*\n* *[<Bb>]*cur[-</Bb>]*\n* *[<Bb>]*rency_positive_feedback\b;<a href="postconf.5.html#default_destination_concurrency_positive_feedback">$&</a>;g;
     s;\bdefault_desti[-</Bb>]*\n* *[<Bb>]*na[-</Bb>]*\n* *[<Bb>]*tion_con[-</Bb>]*\n* *[<Bb>]*cur[-</Bb>]*\n* *[<Bb>]*rency_failed_cohort_limit\b;<a href="postconf.5.html#default_destination_concurrency_failed_cohort_limit">$&</a>;g;
index c8a557767390e20c1f3d844db5396d203f43dcf9..c9c139082010751818ab795c1966fbbbb63138d1 100644 (file)
@@ -704,16 +704,16 @@ verification fails: "unknown" </td> </tr>
 <td> Client name from address &rarr; name lookup <br> When address
 &rarr; name lookup fails: "unknown" </td> </tr>
 
-<tr> <td> {cert_issuer} </td> <td> HELO, MAIL, DATA, EOH, EOM </td> <td>
+<tr> <td> {cert_issuer} </td> <td> HELO, MAIL, DATA </td> <td>
 TLS client certificate issuer </td> </tr>
 
-<tr> <td> {cert_subject} </td> <td> HELO, MAIL, DATA, EOH, EOM </td>
+<tr> <td> {cert_subject} </td> <td> HELO, MAIL, DATA </td>
 <td> TLS client certificate subject </td> </tr>
 
-<tr> <td> {cipher_bits} </td> <td> HELO, MAIL, DATA, EOH, EOM </td> <td>
+<tr> <td> {cipher_bits} </td> <td> HELO, MAIL, DATA </td> <td>
 TLS session key size </td> </tr>
 
-<tr> <td> {cipher} </td> <td> HELO, MAIL, DATA, EOH, EOM </td> <td> TLS
+<tr> <td> {cipher} </td> <td> HELO, MAIL, DATA </td> <td> TLS
 cipher </td> </tr>
 
 <tr> <td> {daemon_addr} </td> <td> Always (Postfix &ge;3.2) </td>
@@ -745,7 +745,10 @@ rejected recipient: enhanced status code </td> </tr>
 smtpd_milters) </td> <td> Recipient mail delivery transport <br>
 With rejected recipient: "error" </td> </tr>
 
-<tr> <td> {tls_version} </td> <td> HELO, MAIL, DATA, EOH, EOM </td>
+<tr> <td> {tls_sni} </td> <td> HELO, MAIL, DATA (Postfix &ge;3.12)
+</td> <td> TLS server name indication </td> </tr>
+
+<tr> <td> {tls_version} </td> <td> HELO, MAIL, DATA </td>
 <td> TLS protocol version </td> </tr>
 
 <tr> <td> v </td> <td> Always </td> <td> value of milter_macro_v
index fae35e141ad1012535b9292fa4ef4ba5969ef147..fa0d39c9c49003e58285358aa2c6a6b77ed449da 100644 (file)
@@ -120,6 +120,8 @@ server_port=54321
 <b>Postfix version 3.8 and later:</b>
 compatibility_level=<i>major</i>.<i>minor</i>.<i>patch</i>
 mail_version=3.8.0
+<b>Postfix version 3.12 and later:</b>
+tls_sni=mail.example.com
 [empty line]
 </pre>
 </blockquote>
@@ -206,6 +208,11 @@ mail_version=3.8.0
     plaintext connections the protocol and cipher attributes are
     empty and the keysize is zero.  </p>
 
+    <li> <p> The "tls_sni" attribute (Postfix 3.12 and later)
+    specifies the server name indication that the remote SMTP client
+    sent in the TLS handshake. This attribute is empty for plaintext
+    connections and when the remote SMTP client sends no SNI. </p>
+
     <li> <p> The "etrn_domain" attribute is defined only in the
     context of the ETRN command, and specifies the ETRN command
     parameter. </p>
index 7dfaf484541ad7982893005022b5c620b18bd6ba..bdb60a9231c99d5d3d7c002e9b30e9cc321f9651 100644 (file)
@@ -19947,6 +19947,15 @@ including the netstring encapsulation. </p>
 
 <p> This feature is available in Postfix &ge; 3.10. </p>
 
+%PARAM socketmap_max_query_size 10000
+
+<p> The maximum allowed query size for a socketmap client, not
+including the socketmap and netstring encapsulation. A request that
+exceeds the limit generates a warning and a 'not found' result.
+</p>
+
+<p> This feature is available in Postfix &ge; 3.12. </p>
+
 %PARAM tls_required_enable yes
 
 <p> Enable support for the "TLS-Required: no" message header, defined
index b9e46b0c088cb7b569cf9ea535a22abb992c2f6c..3cbc187a2f1cc2152eeb2b9bc81a85f0db4e69bb 100644 (file)
 #      socketmap_max_reply_size configuration parameter (Postfix 3.10
 #      and later).
 #
+#      The Postfix socketmap client requires that queries are no longer
+#      than 10000 bytes (not including the netstring encapsulation). This
+#      limit can be changed with the socketmap_max_query_size
+#      configuration parameter (Postfix 3.12 and later).
+#
 #      The Postfix socketmap client enforces a 100s time limit to
 #      connect to a socketmap server, to send a request, and to receive
 #      a reply. It closes an idle connection after 10s, and closes
index 937f37ec6a20af256d5828f1d74c35527c18ed01..510fdbe0c2463d70f52dce382dc06f7abf44d73d 100644 (file)
@@ -1722,3 +1722,13 @@ tlstrace
 yyyymmddhhmmss
 ASAN
 TristanInSec
+Mythos
+Qualys
+linkers
+strncmp
+DEV
+jitter
+msgfree
+optimizers
+resloop
+tokenized
index d7079dd2ac819ded21625c4fd66a26f8d4ff8d84..01c7bc34554ae56983ba633ce5939b68b127ebc3 100644 (file)
@@ -368,6 +368,7 @@ bool    var_verify_neg_cache;
 bool    var_oldlog_compat;
 int     var_delay_max_res;
 int     var_sockmap_max_reply;
+int     var_sockmap_max_query;
 char   *var_int_filt_classes;
 bool    var_cyrus_sasl_authzid;
 
@@ -903,6 +904,7 @@ void    mail_params_init()
        VAR_DELAY_MAX_RES, DEF_DELAY_MAX_RES, &var_delay_max_res, MIN_DELAY_MAX_RES, MAX_DELAY_MAX_RES,
        VAR_INET_WINDOW, DEF_INET_WINDOW, &var_inet_windowsize, 0, 0,
        VAR_SOCKMAP_MAX_REPLY, DEF_SOCKMAP_MAX_REPLY, &var_sockmap_max_reply, 1, 0,
+       VAR_SOCKMAP_MAX_QUERY, DEF_SOCKMAP_MAX_QUERY, &var_sockmap_max_query, 1, 0,
        0,
     };
     static const CONFIG_LONG_TABLE long_defaults[] = {
@@ -1057,6 +1059,7 @@ void    mail_params_init()
     dict_db_cache_size = var_db_read_buf;
     dict_lmdb_map_size = var_lmdb_map_size;
     dict_sockmap_max_reply = var_sockmap_max_reply;
+    dict_sockmap_max_query = var_sockmap_max_query;
     inet_windowsize = var_inet_windowsize;
     if (set_logwriter_create_perms(var_maillog_file_perms) < 0)
        msg_warn("ignoring bad permissions: %s = %s",
index ec934d4a14f94008fd1e7ce9aef912de992b3182..f95d9b72426cce360c6bf6847892337557d30192 100644 (file)
@@ -4634,6 +4634,10 @@ extern char *var_full_name_encoding_charset;
 #define DEF_SOCKMAP_MAX_REPLY  100000  /* reply size limit */
 extern int var_sockmap_max_reply;
 
+#define VAR_SOCKMAP_MAX_QUERY  "socketmap_max_query_size"
+#define DEF_SOCKMAP_MAX_QUERY  10000   /* query size limit */
+extern int var_sockmap_max_query;
+
  /*
   * Client privacy.
   */
index 4c3f33966c1be979a34e71e2cb7f0bfd6af215da..447853dc7ca0a45b41a7ea0299e9bf1630021a1f 100644 (file)
@@ -207,6 +207,7 @@ extern char *mail_pathname(const char *, const char *);
 #define MAIL_ATTR_CRYPTO_PROTOCOL "encryption_protocol"
 #define MAIL_ATTR_CRYPTO_CIPHER        "encryption_cipher"
 #define MAIL_ATTR_CRYPTO_KEYSIZE "encryption_keysize"
+#define MAIL_ATTR_TLS_SNI      "tls_sni"
 #define MAIL_ATTR_COMPAT_LEVEL "compatibility_level"
 #define MAIL_ATTR_MAIL_VERSION "mail_version"
 
index e553abe85c8bdfa0fbcf35e4e7de6bfdaba189a2..e9db761b625caaa8295fe2212901b99b34c36cd5 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      "20260715"
+#define MAIL_RELEASE_DATE      "20260716"
 #define MAIL_VERSION_NUMBER    "3.12"
 
 #ifdef SNAPSHOT
index 3a1e3f94524dbe99745e24969413105d126cba38..8b34652e17f9ddad5ac0439df5913afbeeae1a62 100644 (file)
@@ -186,6 +186,7 @@ extern void milter_free(MILTERS *);
 #define S8_MAC_TLS_VERSION     "{tls_version}"
 #define S8_MAC_CIPHER          "{cipher}"
 #define S8_MAC_CIPHER_BITS     "{cipher_bits}"
+#define S8_MAC_TLS_SNI         "{tls_sni}"
 #define S8_MAC_CERT_SUBJECT    "{cert_subject}"
 #define S8_MAC_CERT_ISSUER     "{cert_issuer}"
 
index 06324edf04abacc1f8d98ffe6114fa40576d0efc..29c6ad0bcc904d14415dcb9a2d3bdd8964559bca 100644 (file)
@@ -208,6 +208,7 @@ static const char *macro_names[] = {
     "{rcpt_host}",
     "{rcpt_mailer}",
     "{tls_version}",
+    "{tls_sni}",
     0,
 };
 
index 5c943632dd260ebd7a6082ca5f1f0e20970e3fed..a3b1d372fbee860dda02c76db6858b7f74e4a2ae 100644 (file)
@@ -1913,7 +1913,6 @@ static void usage(void)
 static BIO *posttls_trace_open(void *arg, const char *trace_peer)
 {
     STATE  *state = (STATE *) arg;
-    struct timeval tv;
     FILE   *fp;
     BIO    *bio;
 
index 6f48e4e69098aea9d190d84cb1c50d64711dd119..50fd0c147bf4e24f97895ba7b5eddc4b727bab0a 100644 (file)
@@ -4138,6 +4138,8 @@ static int check_policy_service(SMTPD_STATE *state, const char *server,
                         IF_ENCRYPTED(state->tls_context->cipher_name, "")),
                          SEND_ATTR_INT(MAIL_ATTR_CRYPTO_KEYSIZE,
                       IF_ENCRYPTED(state->tls_context->cipher_usebits, 0)),
+                         SEND_ATTR_STR(MAIL_ATTR_TLS_SNI,
+                           IF_ENCRYPTED(state->tls_context->peer_sni, "")),
 #endif
                          SEND_ATTR_STR(MAIL_ATTR_POL_CONTEXT,
                                        policy_clnt->policy_context),
index 5deba67981436a5f0433f8b4e5a26ecf6b399d69..c98526bf402259a7f77364952a6601bbd700e5a6 100644 (file)
@@ -136,6 +136,8 @@ const char *smtpd_milter_eval(const char *name, void *ptr)
                        IF_ENCRYPTED(state->tls_context->cipher_usebits));
        return (STR(state->expand_buf));
     }
+    if (strcmp(name, S8_MAC_TLS_SNI) == 0)
+       return (IF_ENCRYPTED(state->tls_context->peer_sni));
     if (strcmp(name, S8_MAC_CERT_SUBJECT) == 0)
        return (IF_TRUSTED(state->tls_context->peer_CN));
     if (strcmp(name, S8_MAC_CERT_ISSUER) == 0)
index 04066142c3fbd9ee0cb5e50803df01400cb31adc..30b7ddfb01acdef4538ec099817657828310d781 100644 (file)
@@ -425,7 +425,6 @@ static int trust_server_ccerts(X509_STORE_CTX *ctx, void *unused)
 TLS_APPL_STATE *tls_server_init(const TLS_SERVER_INIT_PROPS *props)
 {
     SSL_CTX *server_ctx;
-    X509_STORE *cert_store;
     long    off = 0;
     int     verify_flags = SSL_VERIFY_NONE;
     int     cachable;
index d83a6253cda2487d4a26fb034c39169eb7ca1e5b..b4d5879805c7d0905bef24249a467524716c4d67 100644 (file)
@@ -286,7 +286,7 @@ DICT   *dict_nisplus_open(const char *map, int open_flags, int dict_flags)
      * is that the comma character is special in main.cf. When no column
      * number is given at the end of the map name, we use a default column.
      * 
-     * 2026506 Qualys+Mythos: enforce template substution syntax.
+     * 2026506 Qualys+Mythos: enforce template substitution syntax.
      */
     if ((cp = strchr(map, '%')) == 0 || strncmp(cp, "%s", 2) != 0
        || strchr(cp + 2, '%') != 0)
index b96b26cff65bc9596ef424074afdf1551722238f..11ff36e4d6b452b1b37cae49016d3ae509a7b023 100644 (file)
@@ -112,6 +112,7 @@ typedef struct {
   */
 #define DICT_SOCKMAP_DEF_TIMEOUT       100     /* connect/read/write timeout */
 #define DICT_SOCKMAP_DEF_MAX_REPLY     100000  /* reply size limit */
+#define DICT_SOCKMAP_DEF_MAX_QUERY     10000   /* query size limit */
 #define DICT_SOCKMAP_DEF_MAX_IDLE      10      /* close idle socket */
 #define DICT_SOCKMAP_DEF_MAX_TTL       100     /* close old socket */
 
@@ -120,6 +121,7 @@ typedef struct {
   */
 static int dict_sockmap_timeout = DICT_SOCKMAP_DEF_TIMEOUT;
 int     dict_sockmap_max_reply = DICT_SOCKMAP_DEF_MAX_REPLY;
+int     dict_sockmap_max_query = DICT_SOCKMAP_DEF_MAX_QUERY;
 static int dict_sockmap_max_idle = DICT_SOCKMAP_DEF_MAX_IDLE;
 static int dict_sockmap_max_ttl = DICT_SOCKMAP_DEF_MAX_TTL;
 
@@ -172,6 +174,17 @@ static const char *dict_sockmap_lookup(DICT *dict, const char *key)
     if (msg_verbose)
        msg_info("%s: key %s", myname, key);
 
+    /*
+     * Enforce the query size limit. As with UTF-8, an invalid key "does not
+     * exist".
+     */
+    if (dict_sockmap_max_query > 0 && strlen(key) > dict_sockmap_max_query) {
+       msg_warn("table %s:%s query too large: '%.100s', returning 'not found'",
+                dict->type, dict->name, key);
+       dict->error = 0;
+       return (0);
+    }
+
     /*
      * Optionally fold the key.
      */
index 160dfca103cd22f5568bf74a8d349e091575248e..15703206ae2bf16879b938ac4a24ed03eeca6178 100644 (file)
@@ -23,6 +23,7 @@
 
 extern DICT *dict_sockmap_open(const char *, int, int);
 extern int dict_sockmap_max_reply;
+extern int dict_sockmap_max_query;
 
 /* LICENSE
 /* .ad
index f3666baf36ed5fadae677eefe61f5ef23ae7e224..2be5d27b495586a07ce0f2d61f5e681bd47ce4d0 100644 (file)
@@ -379,7 +379,7 @@ NBBIO  *nbbio_create(int fd, ssize_t bufsize, const char *label,
 void    nbbio_free(NBBIO *np)
 {
     nbbio_disable_readwrite(np);
-    /* 202606 Qualys+Mythos: close decriptor only if owner. */
+    /* 202606 Qualys+Mythos: close descriptor only if owner. */
     if (np->flags & NBBIO_FLAG_OWN_FD)
        (void) close(np->fd);
     myfree(np->label);