]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.7-20211030
authorWietse Venema <wietse@porcupine.org>
Sat, 30 Oct 2021 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Wed, 19 Jan 2022 06:36:07 +0000 (01:36 -0500)
28 files changed:
postfix/HISTORY
postfix/html/lmdb_table.5.html
postfix/html/lmtp.8.html
postfix/html/postconf.5.html
postfix/html/postsuper.1.html
postfix/html/smtp.8.html
postfix/man/man1/postsuper.1
postfix/man/man5/lmdb_table.5
postfix/man/man5/postconf.5
postfix/man/man8/smtp.8
postfix/mantools/postlink
postfix/proto/lmdb_table
postfix/proto/postconf.proto
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/postqueue/showq_compat.c
postfix/src/postqueue/showq_json.c
postfix/src/postsuper/postsuper.c
postfix/src/smtp/lmtp_params.c
postfix/src/smtp/smtp.c
postfix/src/smtp/smtp_connect.c
postfix/src/smtp/smtp_params.c
postfix/src/smtpd/smtpd_check.c
postfix/src/tls/tls_dane.c
postfix/src/util/attr.h
postfix/src/util/attr_scan0.c
postfix/src/util/attr_scan64.c
postfix/src/util/attr_scan_plain.c

index ff4e856862ac8409629903476a8026c93a0aff75..b6c8e9eb74617f3a60c15d9d64ddabe2a992e2f6 100644 (file)
@@ -25810,9 +25810,9 @@ Apologies for any names omitted.
 
 20211022
 
-       Bugfix: the known_tcp_ports setting had no effect. Reported
-       by Peter. It also wasn't fully implemented. Files:
-       config_known_tcp_ports.c, mail_params.c,
+       Bugfix (introduced: Postfix 3.6): the known_tcp_ports setting
+       had no effect. Reported by Peter. It also wasn't fully
+       implemented. Files: config_known_tcp_ports.c, mail_params.c,
        posttls-finger/posttls-finger.c, smtp/smtp_connect.c,
        util/find_inet.c, util/myaddrinfo.c.
 
@@ -25821,8 +25821,41 @@ Apologies for any names omitted.
        Documentation: fixed a jq example in the postsuper manpage, to
        delete the quotes around a queue ID. File: postsuper/postsuper.c.
 
-       Cleanup: with "smtputf8_nable = yes" (the default), the
+       Cleanup: with "smtputf8_enable = yes" (the default), the
        postscreen(8) dummy SMTP engine will no longer log a "non-UTF-8
        key" warning when a remote SMTP client sends garbage. Instead,
        postscreen(8) will reject the command with the same server
        repsonse as smtpd(8). File: postscreen/p[ostscreen_smtpd.c.
+
+20211025
+
+       Bugfix (introduced: Postfix 3.6): mangled warning where a
+       hostname and warning message ran together. Viktor Dukhovni.
+       File: tls/tls_dane.c.
+
+20211026
+
+       Feature: with "smtp_bind_address_enforce = yes" the Postfix
+       SMTP client will defer delivery when it is unable to apply
+       the smtp_bind_address or smtp_bind_address6 setting. By
+       default, the Postfix SMTP client continues with delivery,
+       after logging a warning. File: src/smtp/smtp_connect.c.
+
+20211027
+
+       Documentation: readability fix for the text about automatic
+       or explicit daemon restart (postfix reload) after LMDB table
+       change. raj. File: proto/lmdb_table.
+
+       Safety: the postqueue command now sanitizes strings before they
+       are formatted as json output or legacy output. These outputs are
+       piped into other programs that are run by administrative
+       users. This closes a hypothetical opportunity for privilege
+       escalation. Files: util/attr.h, util/attr_scan*.c,
+       postqueue/showq_json.c, postqueue/showq_compat.c.
+
+20211030
+
+       Bugfix: check_ccert_access worked as expected, but produced
+       a spurious warning when Postfix is built without SASL
+       support. Fix by Brad Barden. File: smtpd/smtpd_check.c.
index 41b4bc6d909390c60ae52f20b9ae5817c654bc92..6fbc8b140f8d4779cc99d25c56a15724975dcfa1 100644 (file)
@@ -40,13 +40,12 @@ LMDB_TABLE(5)                                                    LMDB_TABLE(5)
        part, address extension or domain portion.  This behavior is also found
        with, for example, <a href="DATABASE_README.html#types">btree</a>:, <a href="DATABASE_README.html#types">hash</a>:, or <a href="ldap_table.5.html">ldap</a>: tables.
 
-       Unlike other flat-file Postfix databases, changes to an  LMDB  database
-       do  not  trigger  automatic  daemon program restart, and do not require
-       "<b>postfix reload</b>".
+       Changes to an LMDB database do not trigger an automatic daemon restart,
+       and do not require a daemon restart with "<b>postfix reload</b>".
 
 <b>RELIABILITY</b>
        LMDB's copy-on-write architecture provides safe updates, at the cost of
-       using  more space than some other flat-file databases.  Read operations
+       using more space than some other flat-file databases.  Read  operations
        are memory-mapped for speed.  Write operations are not memory-mapped to
        avoid silent corruption due to stray pointer bugs.
 
@@ -55,29 +54,29 @@ LMDB_TABLE(5)                                                    LMDB_TABLE(5)
        as a shared cache for <a href="verify.8.html">verify(8)</a> or <a href="postscreen.8.html">postscreen(8)</a> services.
 
 <b>SYNCHRONIZATION</b>
-       The  Postfix  LMDB adapter does not use LMDB's built-in locking scheme,
-       because that would require world-writable lockfiles and  would  violate
-       the  Postfix security model.  Instead, Postfix uses fcntl(2) locks with
+       The Postfix LMDB adapter does not use LMDB's built-in  locking  scheme,
+       because  that  would require world-writable lockfiles and would violate
+       the Postfix security model.  Instead, Postfix uses fcntl(2) locks  with
        whole-file granularity.  Programs that use LMDB's built-in locking pro-
        tocol will corrupt a Postfix LMDB database or will read garbage.
 
        Every Postfix LMDB database read or write transaction must be protected
-       from start to end with a shared or exclusive fcntl(2) lock.   A  writer
-       may  atomically  downgrade  an  exclusive lock to a shared lock, but it
+       from  start  to end with a shared or exclusive fcntl(2) lock.  A writer
+       may atomically downgrade an exclusive lock to a  shared  lock,  but  it
        must hold an exclusive lock while opening another write transaction.
 
-       Note that fcntl(2) locks do not protect transactions  within  the  same
-       process  against each other.  If a program cannot avoid making simulta-
-       neous database requests, then it must  protect  its  transactions  with
+       Note  that  fcntl(2)  locks do not protect transactions within the same
+       process against each other.  If a program cannot avoid making  simulta-
+       neous  database  requests,  then  it must protect its transactions with
        in-process locks, in addition to the per-process fcntl(2) locks.
 
 <b>CONFIGURATION PARAMETERS</b>
-       Short-lived  programs  automatically  pick up changes to <a href="postconf.5.html">main.cf</a>.  With
-       long-running daemon programs, Use the command "<b>postfix reload</b>" after  a
+       Short-lived programs automatically pick up changes  to  <a href="postconf.5.html">main.cf</a>.   With
+       long-running  daemon programs, Use the command "<b>postfix reload</b>" after a
        configuration change.
 
-       <b><a href="postconf.5.html#lmdb_map_size">lmdb_map_size</a> (default: 16777216)</b>
-              The initial LMDB database size limit in bytes.
+       <b><a href="postconf.5.html#lmdb_map_size">lmdb_map_size</a> (16777216)</b>
+              The initial OpenLDAP LMDB database size limit in bytes.
 
 <b>SEE ALSO</b>
        <a href="postconf.1.html">postconf(1)</a>, Postfix supported lookup tables
index 1b62ba97bccad1e6e51262130c04ccc3807c0917..5491c4ec222932e8797d5f39777763753fb5afa1 100644 (file)
@@ -1017,6 +1017,12 @@ SMTP(8)                                                                SMTP(8)
        <b><a href="postconf.5.html#service_name">service_name</a> (read-only)</b>
               The <a href="master.5.html">master.cf</a> service name of a Postfix daemon process.
 
+       Available in Postfix 3.7 and later:
+
+       <b><a href="postconf.5.html#smtp_bind_address_enforce">smtp_bind_address_enforce</a> (no)</b>
+              Defer  delivery  when  the  Postfix SMTP client cannot apply the
+              <a href="postconf.5.html#smtp_bind_address">smtp_bind_address</a> or <a href="postconf.5.html#smtp_bind_address6">smtp_bind_address6</a> setting.
+
 <b>SEE ALSO</b>
        <a href="generic.5.html">generic(5)</a>, output address rewriting
        <a href="header_checks.5.html">header_checks(5)</a>, message header content inspection
index 0ebb72008998bb6dbcbbf2dd7350fdb9d23b262f..73dca5ce6ed29f82fc28a777235c1ba74adf5424 100644 (file)
@@ -4442,6 +4442,17 @@ parameter.  See there for details. </p>
 <p> This feature is available in Postfix 2.3 and later. </p>
 
 
+</DD>
+
+<DT><b><a name="lmtp_bind_address_enforce">lmtp_bind_address_enforce</a>
+(default: empty)</b></DT><DD>
+
+<p> The LMTP-specific version of the <a href="postconf.5.html#smtp_bind_address_enforce">smtp_bind_address_enforce</a>
+configuration parameter. See there for details. </p>
+
+<p> This feature is available in Postfix 3.7 and later. </p>
+
+
 </DD>
 
 <DT><b><a name="lmtp_body_checks">lmtp_body_checks</a>
@@ -10784,6 +10795,9 @@ for example:
 </pre>
 </blockquote>
 
+<p> See <a href="postconf.5.html#smtp_bind_address_enforce">smtp_bind_address_enforce</a> for how Postfix should handle
+errors (Postfix 3.7 and later). </p>
+
 <p> Note 1: when <a href="postconf.5.html#inet_interfaces">inet_interfaces</a> specifies no more than one IPv4
 address, and that address is a non-loopback address, it is
 automatically used as the <a href="postconf.5.html#smtp_bind_address">smtp_bind_address</a>.  This supports virtual
@@ -10819,6 +10833,9 @@ for example:
 </pre>
 </blockquote>
 
+<p> See <a href="postconf.5.html#smtp_bind_address_enforce">smtp_bind_address_enforce</a> for how Postfix should handle
+errors (Postfix 3.7 and later). </p>
+
 <p> Note 1: when <a href="postconf.5.html#inet_interfaces">inet_interfaces</a> specifies no more than one IPv6
 address, and that address is a non-loopback address, it is
 automatically used as the <a href="postconf.5.html#smtp_bind_address6">smtp_bind_address6</a>.  This supports virtual
@@ -10829,6 +10846,19 @@ IP hosting, but can be a problem on multi-homed firewalls. See the
 but this form is not recommended here. </p>
 
 
+</DD>
+
+<DT><b><a name="smtp_bind_address_enforce">smtp_bind_address_enforce</a>
+(default: no)</b></DT><DD>
+
+<p> Defer delivery when the Postfix SMTP client cannot apply the
+<a href="postconf.5.html#smtp_bind_address">smtp_bind_address</a> or <a href="postconf.5.html#smtp_bind_address6">smtp_bind_address6</a> setting. By default, the
+Postfix SMTP client will continue delivery after logging a warning.
+</p>
+
+<p> This feature is available in Postfix 3.7 and later. </p>
+
+
 </DD>
 
 <DT><b><a name="smtp_body_checks">smtp_body_checks</a>
index 1e7b97193ade2425dcf38ef8103219d22250601b..47b98f3164546c43e9f8609f973569ca4a69789b 100644 (file)
@@ -44,14 +44,14 @@ POSTSUPER(1)                                                      POSTSUPER(1)
               input.  For example, to delete all mail with exactly one recipi-
               ent <b>user@example.com</b>:
 
-              postqueue -j | jq '
+              postqueue -j | jq -r '
                   # See JSON OBJECT FORMAT section in the <a href="postqueue.1.html">postqueue(1)</a> manpage
                   select(.recipients[0].address == "user@example.com")
                   | select(.recipients[1].address == null)
                   | .queue_id
-               ' | tr -d '"' | postsuper -d -
+               ' | postsuper -d -
 
-              Or the historical form:
+              (note the "jq -r" option), or the historical form:
 
               mailq | tail -n +2 | grep -v '^ *(' | awk  'BEGIN { RS = "" }
                   # $7=sender, $8=recipient1, $9=recipient2
index 1b62ba97bccad1e6e51262130c04ccc3807c0917..5491c4ec222932e8797d5f39777763753fb5afa1 100644 (file)
@@ -1017,6 +1017,12 @@ SMTP(8)                                                                SMTP(8)
        <b><a href="postconf.5.html#service_name">service_name</a> (read-only)</b>
               The <a href="master.5.html">master.cf</a> service name of a Postfix daemon process.
 
+       Available in Postfix 3.7 and later:
+
+       <b><a href="postconf.5.html#smtp_bind_address_enforce">smtp_bind_address_enforce</a> (no)</b>
+              Defer  delivery  when  the  Postfix SMTP client cannot apply the
+              <a href="postconf.5.html#smtp_bind_address">smtp_bind_address</a> or <a href="postconf.5.html#smtp_bind_address6">smtp_bind_address6</a> setting.
+
 <b>SEE ALSO</b>
        <a href="generic.5.html">generic(5)</a>, output address rewriting
        <a href="header_checks.5.html">header_checks(5)</a>, message header content inspection
index 772c71c4791495e89880d6adcfde02a88ec32028..885330f1dc4f51316c0e47acc3fe1eb846e7b793 100644 (file)
@@ -46,15 +46,15 @@ from standard input. For example, to delete all mail
 with exactly one recipient \fBuser@example.com\fR:
 .sp
 .nf
-postqueue \-j | jq '
+postqueue \-j | jq -r '
     # See JSON OBJECT FORMAT section in the postqueue(1) manpage
     select(.recipients[0].address == "user@example.com")
     | select(.recipients[1].address == null)
     | .queue_id
- ' | tr \-d '"' | postsuper \-d \-
+ ' | postsuper \-d \-
 .fi
 .sp
-Or the historical form:
+(note the "jq -r" option), or the historical form:
 .sp
 .nf
 mailq | tail \-n +2 | grep \-v '^ *(' | awk  'BEGIN { RS = "" }
index b324f7674009cc95197abca8ec5c495ced1db1da..c4c74d6349ce19ea6907e35c6d90234c20f00b59 100644 (file)
@@ -47,9 +47,9 @@ email addresses without the localpart, address extension
 or domain portion.  This behavior is also found with, for
 example, btree:, hash:, or ldap: tables.
 
-Unlike other flat\-file Postfix databases, changes to
-an LMDB database do not trigger automatic daemon program
-restart, and do not require "\fBpostfix reload\fR".
+Changes to an LMDB database do not trigger an automatic
+daemon restart, and do not require a daemon restart with
+"\fBpostfix reload\fR".
 .SH "RELIABILITY"
 .na
 .nf
@@ -96,8 +96,8 @@ to the per\-process fcntl(2) locks.
 Short\-lived programs automatically pick up changes to
 main.cf.  With long\-running daemon programs, Use the command
 "\fBpostfix reload\fR" after a configuration change.
-.IP "\fBlmdb_map_size (default: 16777216)\fR"
-The initial LMDB database size limit in bytes.
+.IP "\fBlmdb_map_size (16777216)\fR"
+The initial OpenLDAP LMDB database size limit in bytes.
 .SH "SEE ALSO"
 .na
 .nf
index d35c3840e9bacd6fb4aca9c5d42af17aff73a9a2..3c70222535fe6263614f61ae91cebeac3ad44c33 100644 (file)
@@ -2796,6 +2796,11 @@ The LMTP\-specific version of the smtp_bind_address6 configuration
 parameter.  See there for details.
 .PP
 This feature is available in Postfix 2.3 and later.
+.SH lmtp_bind_address_enforce (default: empty)
+The LMTP\-specific version of the smtp_bind_address_enforce
+configuration parameter. See there for details.
+.PP
+This feature is available in Postfix 3.7 and later.
 .SH lmtp_body_checks (default: empty)
 The LMTP\-specific version of the smtp_body_checks configuration
 parameter. See there for details.
@@ -6787,6 +6792,9 @@ for example:
 .ft R
 .in -4
 .PP
+See smtp_bind_address_enforce for how Postfix should handle
+errors (Postfix 3.7 and later).
+.PP
 Note 1: when inet_interfaces specifies no more than one IPv4
 address, and that address is a non\-loopback address, it is
 automatically used as the smtp_bind_address.  This supports virtual
@@ -6816,6 +6824,9 @@ for example:
 .ft R
 .in -4
 .PP
+See smtp_bind_address_enforce for how Postfix should handle
+errors (Postfix 3.7 and later).
+.PP
 Note 1: when inet_interfaces specifies no more than one IPv6
 address, and that address is a non\-loopback address, it is
 automatically used as the smtp_bind_address6.  This supports virtual
@@ -6824,6 +6835,12 @@ inet_interfaces documentation for more detail.
 .PP
 Note 2: address information may be enclosed inside [],
 but this form is not recommended here.
+.SH smtp_bind_address_enforce (default: no)
+Defer delivery when the Postfix SMTP client cannot apply the
+smtp_bind_address or smtp_bind_address6 setting. By default, the
+Postfix SMTP client will continue delivery after logging a warning.
+.PP
+This feature is available in Postfix 3.7 and later.
 .SH smtp_body_checks (default: empty)
 Restricted \fBbody_checks\fR(5) tables for the Postfix SMTP client.
 These tables are searched while mail is being delivered.  Actions
index add4aec34a4fc366d46f447ceee0680f27ad8a6b..477972540e5811a3f67cb3183339d1168d77ec5c 100644 (file)
@@ -893,6 +893,11 @@ The default TCP port that the Postfix SMTP client connects to.
 Available in Postfix 3.3 and later:
 .IP "\fBservice_name (read\-only)\fR"
 The master.cf service name of a Postfix daemon process.
+.PP
+Available in Postfix 3.7 and later:
+.IP "\fBsmtp_bind_address_enforce (no)\fR"
+Defer delivery when the Postfix SMTP client cannot apply the
+smtp_bind_address or smtp_bind_address6 setting.
 .SH "SEE ALSO"
 .na
 .nf
index bc6854c8d8e43c9cd08d33887066c99973ba3654..c1972d13b466557e42cb14cc897e6554e5c8e1ce 100755 (executable)
@@ -462,6 +462,7 @@ while (<>) {
     s;\bsmtp_always_send_ehlo\b;<a href="postconf.5.html#smtp_always_send_ehlo">$&</a>;g;
     s;\bsmtp_bind_address\b;<a href="postconf.5.html#smtp_bind_address">$&</a>;g;
     s;\bsmtp_bind_address6\b;<a href="postconf.5.html#smtp_bind_address6">$&</a>;g;
+    s;\bsmtp_bind_address_enforce\b;<a href="postconf.5.html#smtp_bind_address_enforce">$&</a>;g;
     s;\bsmtp_cname_overrides_servername\b;<a href="postconf.5.html#smtp_cname_overrides_servername">$&</a>;g;
     s;\bsmtp_connect_timeout\b;<a href="postconf.5.html#smtp_connect_timeout">$&</a>;g;
 
index 53a9cd90355258524a336696c7c62932a477af87..5bbbc14d3835fed9433c1248eb1e8bc533a7c073 100644 (file)
@@ -39,9 +39,9 @@
 #      or domain portion.  This behavior is also found with, for
 #      example, btree:, hash:, or ldap: tables.
 #
-#      Unlike other flat-file Postfix databases, changes to
-#      an LMDB database do not trigger automatic daemon program
-#      restart, and do not require "\fBpostfix reload\fR".
+#      Changes to an LMDB database do not trigger an automatic
+#      daemon restart, and do not require a daemon restart with
+#      "\fBpostfix reload\fR".
 # RELIABILITY
 # .ad
 # .fi
@@ -82,8 +82,8 @@
 #      Short-lived programs automatically pick up changes to
 #      main.cf.  With long-running daemon programs, Use the command
 #      "\fBpostfix reload\fR" after a configuration change.
-# .IP "\fBlmdb_map_size (default: 16777216)\fR"
-#      The initial LMDB database size limit in bytes.
+# .IP "\fBlmdb_map_size (16777216)\fR"
+#      The initial OpenLDAP LMDB database size limit in bytes.
 # SEE ALSO
 #      postconf(1), Postfix supported lookup tables
 #      postmap(1), Postfix lookup table maintenance
index a44a51b992f647de85fe2e0e715b1d1efa3eac53..19e5d16df3a30c8fe418c5931f3c1758037bf6fe 100644 (file)
@@ -4017,6 +4017,9 @@ for example:
 </pre>
 </blockquote>
 
+<p> See smtp_bind_address_enforce for how Postfix should handle
+errors (Postfix 3.7 and later). </p>
+
 <p> Note 1: when inet_interfaces specifies no more than one IPv4
 address, and that address is a non-loopback address, it is
 automatically used as the smtp_bind_address.  This supports virtual
@@ -4048,6 +4051,9 @@ for example:
 </pre>
 </blockquote>
 
+<p> See smtp_bind_address_enforce for how Postfix should handle
+errors (Postfix 3.7 and later). </p>
+
 <p> Note 1: when inet_interfaces specifies no more than one IPv6
 address, and that address is a non-loopback address, it is
 automatically used as the smtp_bind_address6.  This supports virtual
@@ -18179,3 +18185,19 @@ feature, called smtp_per_record_deadline, is available with Postfix
 2.9-3.6. </p>
 
 <p> This feature is available in Postfix 3.7 and later. </p>
+
+%PARAM smtp_bind_address_enforce no
+
+<p> Defer delivery when the Postfix SMTP client cannot apply the
+smtp_bind_address or smtp_bind_address6 setting. By default, the
+Postfix SMTP client will continue delivery after logging a warning.
+</p>
+
+<p> This feature is available in Postfix 3.7 and later. </p>
+
+%PARAM lmtp_bind_address_enforce
+
+<p> The LMTP-specific version of the smtp_bind_address_enforce
+configuration parameter. See there for details. </p>
+
+<p> This feature is available in Postfix 3.7 and later. </p>
index e7679e0724cbfa045411d86ddd8377c7f5fd3442..781953c7bebe1f4f6987213241694d5ca10ae1bd 100644 (file)
@@ -1166,6 +1166,12 @@ extern char *var_smtp_bind_addr;
 #define DEF_LMTP_BIND_ADDR6    ""
 extern char *var_smtp_bind_addr6;
 
+#define VAR_SMTP_BIND_ADDR_ENFORCE     "smtp_bind_address_enforce"
+#define DEF_SMTP_BIND_ADDR_ENFORCE     0
+#define VAR_LMTP_BIND_ADDR_ENFORCE     "lmtp_bind_address_enforce"
+#define DEF_LMTP_BIND_ADDR_ENFORCE     0
+extern bool var_smtp_bind_addr_enforce;
+
 #define VAR_SMTP_HELO_NAME     "smtp_helo_name"
 #define DEF_SMTP_HELO_NAME     "$myhostname"
 #define VAR_LMTP_HELO_NAME     "lmtp_lhlo_name"
index 86d963bf7ec99dab944fecb90640c43ce5334256..5766e2cd8b91cc2cee8e563246bbea30748647b7 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      "20211023"
+#define MAIL_RELEASE_DATE      "20211030"
 #define MAIL_VERSION_NUMBER    "3.7"
 
 #ifdef SNAPSHOT
index 2c287830605b5e1f544a93755d1a7a51d81ffa4d..c902b9c5d4e6e17691c7f709f61ff1042985a541 100644 (file)
@@ -109,7 +109,8 @@ static unsigned long showq_message(VSTREAM *showq_stream)
     /*
      * Read the message properties and sender address.
      */
-    if (attr_scan(showq_stream, ATTR_FLAG_MORE | ATTR_FLAG_STRICT,
+    if (attr_scan(showq_stream, ATTR_FLAG_MORE | ATTR_FLAG_STRICT
+                 | ATTR_FLAG_PRINTABLE,
                  RECV_ATTR_STR(MAIL_ATTR_QUEUE, queue_name),
                  RECV_ATTR_STR(MAIL_ATTR_QUEUEID, queue_id),
                  RECV_ATTR_LONG(MAIL_ATTR_TIME, &arrival_time),
@@ -143,7 +144,8 @@ static unsigned long showq_message(VSTREAM *showq_stream)
      * resynchronize.
      */
     while ((showq_status = attr_scan_more(showq_stream)) > 0) {
-       if (attr_scan(showq_stream, ATTR_FLAG_MORE | ATTR_FLAG_STRICT,
+       if (attr_scan(showq_stream, ATTR_FLAG_MORE | ATTR_FLAG_STRICT
+                     | ATTR_FLAG_PRINTABLE,
                      RECV_ATTR_STR(MAIL_ATTR_RECIP, addr),
                      RECV_ATTR_STR(MAIL_ATTR_WHY, why),
                      ATTR_TYPE_END) != 2)
index e9d4fb5703c6c3a12235c583dc4d7b47f40c3412..fc205c72608af3746b3ff7475a24b5ae1b478503 100644 (file)
@@ -150,7 +150,8 @@ static void format_json(VSTREAM *showq_stream)
     /*
      * Read the message properties and sender address.
      */
-    if (attr_scan(showq_stream, ATTR_FLAG_MORE | ATTR_FLAG_STRICT,
+    if (attr_scan(showq_stream, ATTR_FLAG_MORE | ATTR_FLAG_STRICT
+                 | ATTR_FLAG_PRINTABLE,
                  RECV_ATTR_STR(MAIL_ATTR_QUEUE, queue_name),
                  RECV_ATTR_STR(MAIL_ATTR_QUEUEID, queue_id),
                  RECV_ATTR_LONG(MAIL_ATTR_TIME, &arrival_time),
@@ -180,7 +181,8 @@ static void format_json(VSTREAM *showq_stream)
        if (rcpt_count > 0)
            vstream_printf(", ");
        vstream_printf("{");
-       if (attr_scan(showq_stream, ATTR_FLAG_MORE | ATTR_FLAG_STRICT,
+       if (attr_scan(showq_stream, ATTR_FLAG_MORE | ATTR_FLAG_STRICT
+                     | ATTR_FLAG_PRINTABLE,
                      RECV_ATTR_STR(MAIL_ATTR_RECIP, addr),
                      RECV_ATTR_STR(MAIL_ATTR_WHY, why),
                      ATTR_TYPE_END) != 2)
index f2a021ae0b141fa14ca78d64f41393abc28ca00c..d3f2d5bcddd54794dc0cdc8ccaa51be87c1944fb 100644 (file)
 /*     with exactly one recipient \fBuser@example.com\fR:
 /* .sp
 /* .nf
-/*     postqueue -j | jq '
+/*     postqueue -j | jq -r '
 /*         # See JSON OBJECT FORMAT section in the postqueue(1) manpage
 /*         select(.recipients[0].address == "user@example.com")
 /*         | select(.recipients[1].address == null)
 /*         | .queue_id
-/*      ' | tr -d '"' | postsuper -d -
+/*      ' | postsuper -d -
 /* .fi
 /* .sp
-/*     Or the historical form:
+/*     (note the "jq -r" option), or the historical form:
 /* .sp
 /* .nf
 /*     mailq | tail -n +2 | grep -v '^ *(' | awk  'BEGIN { RS = "" }
index d4ddfdb652bbf3579ba96a8a2cd329dc81bd17bf..cc3364642d56197063fb8ba0be069a29eca9d7bc 100644 (file)
        VAR_LMTP_ASSUME_FINAL, DEF_LMTP_ASSUME_FINAL, &var_lmtp_assume_final,
        VAR_LMTP_DUMMY_MAIL_AUTH, DEF_LMTP_DUMMY_MAIL_AUTH, &var_smtp_dummy_mail_auth,
        VAR_LMTP_BALANCE_INET_PROTO, DEF_LMTP_BALANCE_INET_PROTO, &var_smtp_balance_inet_proto,
+       VAR_LMTP_BIND_ADDR_ENFORCE, DEF_LMTP_BIND_ADDR_ENFORCE, &var_smtp_bind_addr_enforce,
        0,
     };
     static const CONFIG_NBOOL_TABLE lmtp_nbool_table[] = {
index 60c8fe95e90fc3fa6adca44869984cc2bfe1e5fd..0561d070c83eeb9c6fad2eea980bc9ae591c1f77 100644 (file)
 /*     Available in Postfix 3.3 and later:
 /* .IP "\fBservice_name (read-only)\fR"
 /*     The master.cf service name of a Postfix daemon process.
+/* .PP
+/*     Available in Postfix 3.7 and later:
+/* .IP "\fBsmtp_bind_address_enforce (no)\fR"
+/*     Defer delivery when the Postfix SMTP client cannot apply the
+/*     smtp_bind_address or smtp_bind_address6 setting.
 /* SEE ALSO
 /*     generic(5), output address rewriting
 /*     header_checks(5), message header content inspection
@@ -1087,6 +1092,7 @@ int     var_smtp_sasl_auth_cache_time;
 bool    var_smtp_sasl_auth_soft_bounce;
 
 char   *var_hfrom_format;
+bool var_smtp_bind_addr_enforce;
 
  /*
   * Global variables.
index f93e7efc64480e8da8465cde64b93da965badaad..b7bdf253bb7d4e2fae1cb31b9c558f8c709de2b3 100644 (file)
@@ -228,9 +228,14 @@ static SMTP_SESSION *smtp_connect_addr(SMTP_ITERATOR *iter, DSN_BUF *why,
        if ((aierr = hostaddr_to_sockaddr(bind_addr, (char *) 0, 0, &res0)) != 0)
            msg_fatal("%s: bad %s parameter: %s: %s",
                      myname, bind_var, bind_addr, MAI_STRERROR(aierr));
-       if (bind(sock, res0->ai_addr, res0->ai_addrlen) < 0)
+       if (bind(sock, res0->ai_addr, res0->ai_addrlen) < 0) {
            msg_warn("%s: bind %s: %m", myname, bind_addr);
-       else if (msg_verbose)
+           if (var_smtp_bind_addr_enforce) {
+               freeaddrinfo(res0);
+               dsb_simple(why, "4.4.0", "server configuration error");
+               return (0);
+           }
+       } else if (msg_verbose)
            msg_info("%s: bind %s", myname, bind_addr);
        freeaddrinfo(res0);
     }
index ef65bc547e0b3da7875443c07c233fc81f459c32..cd54f8fcbdfe8b199ddb2a881a1e963f5002e36d 100644 (file)
        VAR_LMTP_ASSUME_FINAL, DEF_LMTP_ASSUME_FINAL, &var_lmtp_assume_final,
        VAR_SMTP_DUMMY_MAIL_AUTH, DEF_SMTP_DUMMY_MAIL_AUTH, &var_smtp_dummy_mail_auth,
        VAR_SMTP_BALANCE_INET_PROTO, DEF_SMTP_BALANCE_INET_PROTO, &var_smtp_balance_inet_proto,
+       VAR_SMTP_BIND_ADDR_ENFORCE, DEF_SMTP_BIND_ADDR_ENFORCE, &var_smtp_bind_addr_enforce,
        0,
     };
     static const CONFIG_NBOOL_TABLE smtp_nbool_table[] = {
index 1a2d558ab53f3a2f4a485be551c4d40e92437519..5bbee93b24d745f38f380b2560d303435ce3d412 100644 (file)
@@ -4374,8 +4374,8 @@ static int generic_checks(SMTPD_STATE *state, ARGV *restrictions,
            }
        } else if (is_map_command(state, name, CHECK_CCERT_ACL, &cpp)) {
            status = check_ccert_access(state, *cpp, def_acl);
-#ifdef USE_SASL_AUTH
        } else if (is_map_command(state, name, CHECK_SASL_ACL, &cpp)) {
+#ifdef USE_SASL_AUTH
            if (var_smtpd_sasl_enable) {
                if (state->sasl_username && state->sasl_username[0])
                    status = check_sasl_access(state, *cpp, def_acl);
index a31a513742201806aa1ca868fa2e58774c7bc22a..752bb5b1c2f7a564e0f452c516ef941e6d53a3d3 100644 (file)
@@ -392,7 +392,7 @@ static void tlsa_carp(const char *s1, const char *s2, const char *s3,
        vstring_sprintf(top, "...");
     }
 
-    msg_warn("%s%s%s%s: %u %u %u %s%s%s", s1, s2, s3, s4, u, s, m, STR(top),
+    msg_warn("%s%s%s %s: %u %u %u %s%s%s", s1, s2, s3, s4, u, s, m, STR(top),
             dlen > MAX_DUMP_BYTES ? "..." : "",
             dlen > MAX_DUMP_BYTES ? STR(bot) : "");
 }
@@ -807,13 +807,13 @@ int     tls_dane_enable(TLS_SESS_STATE *TLScontext)
            continue;
        }
        if (ret == 0) {
-           tlsa_carp(TLScontext->namaddr, ": ", "", "unusable TLSA RR",
+           tlsa_carp(TLScontext->namaddr, ":", "", "unusable TLSA RR",
                      tp->usage, tp->selector, tp->mtype, tp->data,
                      tp->length);
            continue;
        }
        /* Internal problem in OpenSSL */
-       tlsa_carp(TLScontext->namaddr, ": ", "", "error loading trust settings",
+       tlsa_carp(TLScontext->namaddr, ":", "", "error loading trust settings",
                  tp->usage, tp->selector, tp->mtype, tp->data, tp->length);
        tls_print_errors();
        return (-1);
index c62c226073a09eaf9099b05285d7661d8d466879..067405f58f206a885f6675bb4d1d490c9f510ce5 100644 (file)
@@ -101,9 +101,10 @@ CHECK_VAL_HELPER_DCL(ATTR, ATTR_SCAN_CUSTOM_FN);
 #define ATTR_FLAG_MISSING      (1<<0)  /* Flag missing attribute */
 #define ATTR_FLAG_EXTRA                (1<<1)  /* Flag spurious attribute */
 #define ATTR_FLAG_MORE         (1<<2)  /* Don't skip or terminate */
+#define ATTR_FLAG_PRINTABLE    (1<<3)  /* Sanitize received strings */
 
 #define ATTR_FLAG_STRICT       (ATTR_FLAG_MISSING | ATTR_FLAG_EXTRA)
-#define ATTR_FLAG_ALL          (07)
+#define ATTR_FLAG_ALL          (017)
 
  /*
   * Default to null-terminated, as opposed to base64-encoded.
index 57746407c0819be8695fed3681b0892e6427bd39..13aa12504a568a92f26fc1b1cd34e6f1e089e316 100644 (file)
@@ -86,6 +86,8 @@
 /*     same input attribute list.
 /*     By default, attr_scan0() skips forward past the input attribute list
 /*     terminator.
+/* .IP ATTR_FLAG_PRINTABLE
+/*     Santize received string values with printable(_, '?').
 /* .IP ATTR_FLAG_STRICT
 /*     For convenience, this value combines both ATTR_FLAG_MISSING and
 /*     ATTR_FLAG_EXTRA.
 #include <vstring_vstream.h>
 #include <htable.h>
 #include <base64_code.h>
+#include <stringops.h>
 #include <attr.h>
 
 /* Application specific. */
@@ -412,6 +415,8 @@ int     attr_vscan0(VSTREAM *fp, int flags, va_list ap)
            if ((ch = attr_scan0_string(fp, string,
                                        "input attribute value")) < 0)
                return (-1);
+           if (flags & ATTR_FLAG_PRINTABLE)
+               (void) printable(STR(string), '?');
            break;
        case ATTR_TYPE_DATA:
            string = va_arg(ap, VSTRING *);
@@ -443,6 +448,10 @@ int     attr_vscan0(VSTREAM *fp, int flags, va_list ap)
            if ((ch = attr_scan0_string(fp, str_buf,
                                        "input attribute value")) < 0)
                return (-1);
+           if (flags & ATTR_FLAG_PRINTABLE) {
+               (void) printable(STR(name_buf), '?');
+               (void) printable(STR(str_buf), '?');
+           }
            if (htable_locate(hash_table, STR(name_buf)) != 0) {
                if ((flags & ATTR_FLAG_EXTRA) != 0) {
                    msg_warn("duplicate attribute %s in input from %s",
index 0a5eb3ee53dddbcb3aa8b0d857cb06127ace290d..0d9b114c478685c02d1ccae5d8f3fb27e40346bc 100644 (file)
@@ -88,6 +88,8 @@
 /*     same input attribute list.
 /*     By default, attr_scan64() skips forward past the input attribute list
 /*     terminator.
+/* .IP ATTR_FLAG_PRINTABLE
+/*     Santize received string values with printable(_, '?').
 /* .IP ATTR_FLAG_STRICT
 /*     For convenience, this value combines both ATTR_FLAG_MISSING and
 /*     ATTR_FLAG_EXTRA.
 #include <vstring.h>
 #include <htable.h>
 #include <base64_code.h>
+#include <stringops.h>
 #include <attr.h>
 
 /* Application specific. */
@@ -451,6 +454,8 @@ int     attr_vscan64(VSTREAM *fp, int flags, va_list ap)
                         STR(name_buf), VSTREAM_PATH(fp));
                return (-1);
            }
+           if (flags & ATTR_FLAG_PRINTABLE)
+               (void) printable(STR(string), '?');
            break;
        case ATTR_TYPE_DATA:
            if (ch != ':') {
@@ -512,6 +517,10 @@ int     attr_vscan64(VSTREAM *fp, int flags, va_list ap)
                         STR(name_buf), VSTREAM_PATH(fp));
                return (-1);
            }
+           if (flags & ATTR_FLAG_PRINTABLE) {
+               (void) printable(STR(name_buf), '?');
+               (void) printable(STR(str_buf), '?');
+           }
            if (htable_locate(hash_table, STR(name_buf)) != 0) {
                if ((flags & ATTR_FLAG_EXTRA) != 0) {
                    msg_warn("duplicate attribute %s in input from %s",
index b003d4585fa513c5e7cf3ca4642940911ab174da..d7e2f6677fcf1857ef981147515c4900feec3984 100644 (file)
@@ -86,6 +86,8 @@
 /*     from the same input attribute list.
 /*     By default, attr_scan_plain() skips forward past the input attribute
 /*     list terminator.
+/* .IP ATTR_FLAG_PRINTABLE
+/*     Santize received string values with printable(_, '?').
 /* .IP ATTR_FLAG_STRICT
 /*     For convenience, this value combines both ATTR_FLAG_MISSING and
 /*     ATTR_FLAG_EXTRA.
 #include <vstring.h>
 #include <htable.h>
 #include <base64_code.h>
+#include <stringops.h>
 #include <attr.h>
 
 /* Application specific. */
@@ -444,6 +447,8 @@ int     attr_vscan_plain(VSTREAM *fp, int flags, va_list ap)
            if ((ch = attr_scan_plain_string(fp, string, 0,
                                             "input attribute value")) < 0)
                return (-1);
+           if (flags & ATTR_FLAG_PRINTABLE)
+               (void) printable(STR(string), '?');
            break;
        case ATTR_TYPE_DATA:
            if (ch != '=') {
@@ -490,6 +495,10 @@ int     attr_vscan_plain(VSTREAM *fp, int flags, va_list ap)
            if ((ch = attr_scan_plain_string(fp, str_buf, 0,
                                             "input attribute value")) < 0)
                return (-1);
+           if (flags & ATTR_FLAG_PRINTABLE) {
+               (void) printable(STR(name_buf), '?');
+               (void) printable(STR(str_buf), '?');
+           }
            if (htable_locate(hash_table, STR(name_buf)) != 0) {
                if ((flags & ATTR_FLAG_EXTRA) != 0) {
                    msg_warn("duplicate attribute %s in input from %s",