]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.9-20240110
authorWietse Venema <wietse@porcupine.org>
Wed, 10 Jan 2024 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <ietf-dane@dukhovni.org>
Fri, 12 Jan 2024 22:08:43 +0000 (17:08 -0500)
13 files changed:
postfix/HISTORY
postfix/RELEASE_NOTES
postfix/html/cleanup.8.html
postfix/html/postconf.5.html
postfix/html/smtpd.8.html
postfix/man/man5/postconf.5
postfix/man/man8/cleanup.8
postfix/man/man8/smtpd.8
postfix/mantools/postlink
postfix/proto/postconf.proto
postfix/src/cleanup/cleanup.c
postfix/src/global/mail_version.h
postfix/src/smtpd/smtpd.c

index 843d57711857579ae2a3d367525f789cdd2d27ce..ae06945e0382755b3b9385524303b82c7e3e3617 100644 (file)
@@ -27702,3 +27702,10 @@ Apologies for any names omitted.
        server handles stray <CR> or <LF> characters. Files:
        global/mail_params.h, cleanup/cleanup.c, cleanup/cleanup_message.c,
        mantools/postlink, proto/postconf.proto.
+
+20240110
+
+       Cleanup: the smtpd_forbid_bare_newline settings "normalize"
+       and "reject" are now more similar. Both now unconditionally
+       require the standard End-of-DATA sequence <CR><LF>.<CR><LF>.
+       Files: smtpd/smtpd.c, proto/postconf.proto, RELEASE_NOTES.
index 470215bc8f8d1068767e876b9b53d68b53751a8a..efcf52cef3b488e3dfa059c0804ff595e0867c88 100644 (file)
@@ -26,7 +26,7 @@ now also distributed with the more recent Eclipse Public License
 license of their choice. Those who are more comfortable with the
 IPL can continue with that license.
 
-Incompatibility with snapshot 20240109
+Incompatibility with snapshot 20240110
 =======================================
 
 Outbound SMTP smuggling: with "cleanup_replace_stray_cr_lf = yes", the
@@ -35,40 +35,36 @@ content with a space character. The replacement happens before any other
 content management.
 
 This prevents outbound SMTP smuggling, where an attacker uses Postfix
-to send a non-standard End-of-DATA sequence that triggers inbound
-SMTP smuggling at a remote SMTP server.
+to send email with a non-standard End-of-DATA sequence that exploits
+inbound SMTP smuggling at a vulnerable SMTP server.
 
-This also ensures that the evaluation of Postfix-added DKIM etc.
-signatures will not depend on how a remote mail server handles stray <CR>
-or <LF> characters.
+This also ensures that the evaluation of Postfix-added DKIM and
+other signatures will not depend on how a remote mail server handles
+stray <CR> or <LF> characters.
 
 This feature applies to all email that Postfix locally or remotely
-out. It is not allowlisted based on client identity.
+sends out. It is not allowlisted based on client identity.
 
-Major changes with snapshot 20240106
-====================================
-
-Inbound SMTP smuggling: strip extra <CR> in <CR><LF>.<CR><CR><LF>,
-to silence some tools that send attack sequences that are not viable.
-Details at https://www.postfix.org/false-smuggling-claims.html
-
-Major changes with snapshot 20240102
+Major changes with snapshot 20240110
 ====================================
 
 This updates Postfix fixes for SMTP smuggling attacks, For background,
 see https://www.postfix.org/smtp-smuggling.html
 
-This release improves configuration (see below) and logging for rejected
-input (it now includes helo, mail, and rcpt information if available).
 This will be back ported to Postfix 3.8.5, 3.7.10, 3.6.14, and 3.5.24.
 
-- The new setting "smtpd_forbid_bare_newline = normalize" allows
-  bare newlines from local and remote SMTP clients that send bare
-  newlines consistently, and maintains more compatibility with
-  infrastructure tools such as probers and surveys.
+- Improved logging for rejected input (it now includes queue ID,
+  helo, mail, and rcpt, if available).
 
-- The new setting "smtpd_forbid_bare_newline = reject" rejects a
-  command or message that contains a bare newline. To disconnect
+- The new default setting "smtpd_forbid_bare_newline = normalize"
+  requires the standard End-of-DATA sequence <CR><LF>.<CR><LF>, and
+  allows bare newlines from local and remote SMTP clients, maintaining
+  more compatibility with infrastructure tools such as probers and
+  surveys.
+
+- The new setting "smtpd_forbid_bare_newline = reject" requires
+  the standard End-of-DATA sequence <CR><LF>.<CR><LF>, and rejects
+  a command or message that contains a bare newline. To disconnect
   the client, specify "smtpd_forbid_bare_newline_reject_code = 521".
 
 - The old setting "yes" has become an alias for "normalize".
@@ -77,31 +73,37 @@ This will be back ported to Postfix 3.8.5, 3.7.10, 3.6.14, and 3.5.24.
 
 The recommended Postfix 3.9 settings (i.e. the defaults) are now:
 
-    # Allow bare newlines from local and remote SMTP clients. If any DATA
-    # content line ends in <CR><LF>, require the standard End-of-DATA form
-    # <CR><LF>.<CR><LF>, and skip other End-of-DATA forms.
+    # Require the standard End-of-DATA sequence <CR><LF>.<CR><LF>.
+    # Allow bare newlines from local and remote SMTP clients.
     #
-    # This may cause problems for legitimate clients that send
-    # non-standard line endings such web applications, netcat, fax
-    # machines, or load balancer health checks. Such clients need to be
-    # excluded with smtpd_forbid_bare_newline_exclusions.
+    # This will cause problems for legitimate clients that send a
+    # non-standard End-of-DATA sequence such as web applications, netcat,
+    # fax machines, or load balancer health checks. Such clients need
+    # to be excluded with smtpd_forbid_bare_newline_exclusions.
     #
     smtpd_forbid_bare_newline = normalize
     smtpd_forbid_bare_newline_exclusions = $mynetworks
 
 Alternative settings:
 
-    # Reject bare newlines from remote SMTP clients. Require the standard
-    # End-of-DATA form <CR><LF>.<CR><LF>.
+    # Require the standard End-of-DATA sequence <CR><LF>.<CR><LF>.
+    # Reject bare newlines from remote SMTP clients.
     #
-    # This will cause problems for legitimate clients that send
-    # non-standard line endings such web applications, netcat, fax
+    # This will cause problems for legitimate clients that send any
+    # non-standard line endings such as web applications, netcat, fax
     # machines, or load balancer health checks. Such clients need to be
     # excluded with smtpd_forbid_bare_newline_exclusions.
     #
     smtpd_forbid_bare_newline = reject
     smtpd_forbid_bare_newline_exclusions = $mynetworks
 
+Major changes with snapshot 20240106
+====================================
+
+Inbound SMTP smuggling: strip extra <CR> in <CR><LF>.<CR><CR><LF>,
+to silence some tools that send attack sequences that are not viable.
+Details at https://www.postfix.org/false-smuggling-claims.html
+
 Incompatible changes with snapshot 20231221
 ===========================================
 
index b90af83994780af1dd9d44e8f3e868fddc7f6a2d..e4ecd4398b77f544fff1e6fb71796f785dbfb687 100644 (file)
@@ -166,7 +166,9 @@ CLEANUP(8)                                                          CLEANUP(8)
        <b><a href="postconf.5.html#cleanup_replace_stray_cr_lf">cleanup_replace_stray_cr_lf</a> (yes)</b>
               Replace  each  stray  &lt;CR&gt;  or &lt;LF&gt; character in message content
               with a space character, to prevent outbound SMTP smuggling,  and
-              to make the evaluation of Postfix-added DKIM etc.
+              to make the evaluation of Postfix-added DKIM or other signatures
+              independent from how a remote mail server handles  such  charac-
+              ters.
 
 <b>BEFORE QUEUE MILTER CONTROLS</b>
        As of version 2.3, Postfix supports the Sendmail version 8 Milter (mail
index df52fc91ae5e87f9dd09ece56c2818d560f486b3..75f304130d46640794403c349c31adc63d33b476 100644 (file)
@@ -1476,7 +1476,7 @@ Examples:
 
 <p> Replace each stray &lt;CR&gt; or &lt;LF&gt; character in message
 content with a space character, to prevent outbound SMTP smuggling,
-and to make the evaluation of Postfix-added DKIM etc. signatures
+and to make the evaluation of Postfix-added DKIM or other signatures
 independent from how a remote mail server handles such characters.
 </p>
 
@@ -15958,35 +15958,33 @@ This feature is available in Postfix 2.0 and later.
 <DT><b><a name="smtpd_forbid_bare_newline">smtpd_forbid_bare_newline</a>
 (default: Postfix &ge; 3.9: normalize)</b></DT><DD>
 
-<p> Reject or normalize commands and email message content when a
-remote SMTP client sends lines ending in &lt;LF&gt;. Such line
-endings are commonly allowed with UNIX-based SMTP servers, but they
-violate the <a href="https://tools.ietf.org/html/rfc5321">RFC 5321</a> requirement that lines must end in
-&lt;CR&gt;&lt;LF&gt;. <.p>
+<p> Reject or normalize commands and email message content when an
+SMTP client sends lines ending in &lt;LF&gt;. Such line endings are
+commonly allowed with UNIX-based SMTP servers, but they violate the
+<a href="https://tools.ietf.org/html/rfc5321">RFC 5321</a> requirement that lines must end in &lt;CR&gt;&lt;LF&gt;.
+</p>
 
 <p> Specify one of the following values (case does not matter): </p>
 
 <dl compact>
 
-<dt> <b>normalize</b> </dt> <dd> Maintain compatibility with legacy
-SMTP clients that send lines ending in the non-standard &lt;LF&gt;,
-and treat those line endings as if the client sent the standard
-&lt;CR&gt;&lt;LF&gt;. However, if an SMTP client sends any DATA
-content line ending in the standard &lt;CR&gt;&lt;LF&gt;, require
-the standard End-of-DATA form &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;,
-and skip non-standard End-of-DATA forms. <br> This may fail to
-receive email from legitimate SMTP clients that send non-standard
-line endings such web applications, netcat, fax machines, or load
-balancer health checks. Such clients need to be excluded with
-<a href="postconf.5.html#smtpd_forbid_bare_newline_exclusions">smtpd_forbid_bare_newline_exclusions</a>. </dd>
+<dt> <b>normalize</b> (default)</dt> <dd> Require the standard
+End-of-DATA sequence &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;.
+Otherwise, maintain compatibility with legacy SMTP clients that
+send lines ending in the non-standard &lt;LF&gt;, and treat those
+line endings as if the client sent the standard &lt;CR&gt;&lt;LF&gt;.
+<br> This may fail to receive email from legitimate SMTP clients
+such web applications, netcat, fax machines, or load balancer health
+checks.  Such clients need to be excluded with
+<a href="postconf.5.html#smtpd_forbid_bare_newline_exclusions">smtpd_forbid_bare_newline_exclusions</a>.  </dd>
 
 <dt> <b>yes</b> </dt> <dd> Alias for "normalize". </dd>
 
-<dt> <b>reject</b> </dt> <dd> When an SMTP client sends a command
-or message content line ending in &lt;LF&gt;, log a "bare &lt;LF&gt;
-received" error, reject the command or message content with
-<a href="postconf.5.html#smtpd_forbid_bare_newline_reject_code">smtpd_forbid_bare_newline_reject_code</a>, and require the standard
-End-of-DATA form &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;. <br>
+<dt> <b>reject</b> </dt> <dd> Require the standard End-of-DATA
+sequence &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;. When an SMTP
+client sends a command or message content line ending in &lt;LF&gt;,
+log a "bare &lt;LF&gt; received" error, and reject the command or
+message content with $<a href="postconf.5.html#smtpd_forbid_bare_newline_reject_code">smtpd_forbid_bare_newline_reject_code</a>. <br>
 This will fail to receive email from legitimate SMTP clients that
 send non-standard line endings such web applications, netcat, fax
 machines, or load balancer health checks. Such clients need to be
@@ -16005,14 +16003,13 @@ href="https://www.postfix.org/smtp-smuggling.html"> SMTP smuggling</a>.
 
 <blockquote>
 <pre>
-# Allow bare newlines from local and remote SMTP clients. If any DATA
-# content line ends in &lt;CR&gt;&lt;LF&gt;, require the standard End-of-DATA form
-# &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt; and skip other End-of-DATA forms.
+# Require the standard End-of-DATA sequence &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;.
+# Allow bare newlines from local and remote SMTP clients.
 #
-# This may cause problems for legitimate clients that send
-# non-standard line endings such as web applications, netcat, fax
-# machines, or load balancer health checks. Such clients need to be
-# excluded with <a href="postconf.5.html#smtpd_forbid_bare_newline_exclusions">smtpd_forbid_bare_newline_exclusions</a>.
+# This will cause problems for legitimate clients that send a
+# non-standard End-of-DATA sequence such as web applications, netcat,
+# fax machines, or load balancer health checks. Such clients need
+# to be excluded with <a href="postconf.5.html#smtpd_forbid_bare_newline_exclusions">smtpd_forbid_bare_newline_exclusions</a>.
 #
 <a href="postconf.5.html#smtpd_forbid_bare_newline">smtpd_forbid_bare_newline</a> = normalize
 <a href="postconf.5.html#smtpd_forbid_bare_newline_exclusions">smtpd_forbid_bare_newline_exclusions</a> = $<a href="postconf.5.html#mynetworks">mynetworks</a>
@@ -16021,10 +16018,10 @@ href="https://www.postfix.org/smtp-smuggling.html"> SMTP smuggling</a>.
 
 <blockquote>
 <pre>
-# Reject bare newlines from remote SMTP clients. Require the standard
-# End-of-DATA form &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;.
+# Require the standard End-of-DATA sequence &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;.
+# Reject bare newlines from remote SMTP clients.
 #
-# This will cause problems for legitimate clients that send
+# This will cause problems for legitimate clients that send any
 # non-standard line endings such as web applications, netcat, fax
 # machines, or load balancer health checks. Such clients need to be
 # excluded with <a href="postconf.5.html#smtpd_forbid_bare_newline_exclusions">smtpd_forbid_bare_newline_exclusions</a>.
index cfeeed9829d08be842be09d2c73dadcbc6b50f2e..433b7d40e8275bb31fb544befa360919a458cc04 100644 (file)
@@ -998,8 +998,8 @@ SMTPD(8)                                                              SMTPD(8)
        Available in Postfix 3.9, 3.8.4, 3.7.9, 3.6.13, 3.5.23 and later:
 
        <b><a href="postconf.5.html#smtpd_forbid_bare_newline">smtpd_forbid_bare_newline</a> (Postfix</b> &gt;<b>= 3.9: normalize)</b>
-              Reject  or  normalize  commands and email message content when a
-              remote SMTP client sends lines ending in &lt;LF&gt;.
+              Reject  or  normalize commands and email message content when an
+              SMTP client sends lines ending in &lt;LF&gt;.
 
        <b><a href="postconf.5.html#smtpd_forbid_bare_newline_exclusions">smtpd_forbid_bare_newline_exclusions</a> ($<a href="postconf.5.html#mynetworks">mynetworks</a>)</b>
               Exclude the  specified  clients  from  <a href="postconf.5.html#smtpd_forbid_bare_newline">smtpd_forbid_bare_newline</a>
index dbdb3205eee4214087e261aa51d80342612427fc..b565beaee448f0e810db1f729f05b24eb0bf42f8 100644 (file)
@@ -886,7 +886,7 @@ canonical_maps = hash:/etc/postfix/canonical
 .SH cleanup_replace_stray_cr_lf (default: yes)
 Replace each stray <CR> or <LF> character in message
 content with a space character, to prevent outbound SMTP smuggling,
-and to make the evaluation of Postfix\-added DKIM etc. signatures
+and to make the evaluation of Postfix\-added DKIM or other signatures
 independent from how a remote mail server handles such characters.
 .PP
 SMTP does not allow such characters unless they are part of a
@@ -11030,37 +11030,33 @@ parameter $name expansion.
 .PP
 This feature is available in Postfix 2.0 and later.
 .SH smtpd_forbid_bare_newline (default: Postfix >= 3.9: normalize)
-Reject or normalize commands and email message content when a
-remote SMTP client sends lines ending in <LF>. Such line
-endings are commonly allowed with UNIX\-based SMTP servers, but they
-violate the RFC 5321 requirement that lines must end in
-<CR><LF>. <.p>
+Reject or normalize commands and email message content when an
+SMTP client sends lines ending in <LF>. Such line endings are
+commonly allowed with UNIX\-based SMTP servers, but they violate the
+RFC 5321 requirement that lines must end in <CR><LF>.
 .PP
 Specify one of the following values (case does not matter):
-.IP "\fBnormalize\fR"
-Maintain compatibility with legacy
-SMTP clients that send lines ending in the non\-standard <LF>,
-and treat those line endings as if the client sent the standard
-<CR><LF>. However, if an SMTP client sends any DATA
-content line ending in the standard <CR><LF>, require
-the standard End\-of\-DATA form <CR><LF>.<CR><LF>,
-and skip non\-standard End\-of\-DATA forms.
-.br
-This may fail to
-receive email from legitimate SMTP clients that send non\-standard
-line endings such web applications, netcat, fax machines, or load
-balancer health checks. Such clients need to be excluded with
+.IP "\fBnormalize\fR (default)"
+Require the standard
+End\-of\-DATA sequence <CR><LF>.<CR><LF>.
+Otherwise, maintain compatibility with legacy SMTP clients that
+send lines ending in the non\-standard <LF>, and treat those
+line endings as if the client sent the standard <CR><LF>.
+.br
+This may fail to receive email from legitimate SMTP clients
+such web applications, netcat, fax machines, or load balancer health
+checks.  Such clients need to be excluded with
 smtpd_forbid_bare_newline_exclusions.
 .br
 .IP "\fByes\fR"
 Alias for "normalize".
 .br
 .IP "\fBreject\fR"
-When an SMTP client sends a command
-or message content line ending in <LF>, log a "bare <LF>
-received" error, reject the command or message content with
-smtpd_forbid_bare_newline_reject_code, and require the standard
-End\-of\-DATA form <CR><LF>.<CR><LF>.
+Require the standard End\-of\-DATA
+sequence <CR><LF>.<CR><LF>. When an SMTP
+client sends a command or message content line ending in <LF>,
+log a "bare <LF> received" error, and reject the command or
+message content with $smtpd_forbid_bare_newline_reject_code.
 .br
 This will fail to receive email from legitimate SMTP clients that
 send non\-standard line endings such web applications, netcat, fax
@@ -11081,14 +11077,13 @@ Examples:
 .nf
 .na
 .ft C
-# Allow bare newlines from local and remote SMTP clients. If any DATA
-# content line ends in <CR><LF>, require the standard End\-of\-DATA form
-# <CR><LF>.<CR><LF> and skip other End\-of\-DATA forms.
+# Require the standard End\-of\-DATA sequence <CR><LF>.<CR><LF>.
+# Allow bare newlines from local and remote SMTP clients.
 #
-# This may cause problems for legitimate clients that send
-# non\-standard line endings such as web applications, netcat, fax
-# machines, or load balancer health checks. Such clients need to be
-# excluded with smtpd_forbid_bare_newline_exclusions.
+# This will cause problems for legitimate clients that send a
+# non\-standard End\-of\-DATA sequence such as web applications, netcat,
+# fax machines, or load balancer health checks. Such clients need
+# to be excluded with smtpd_forbid_bare_newline_exclusions.
 #
 smtpd_forbid_bare_newline = normalize
 smtpd_forbid_bare_newline_exclusions = $mynetworks
@@ -11101,10 +11096,10 @@ smtpd_forbid_bare_newline_exclusions = $mynetworks
 .nf
 .na
 .ft C
-# Reject bare newlines from remote SMTP clients. Require the standard
-# End\-of\-DATA form <CR><LF>.<CR><LF>.
+# Require the standard End\-of\-DATA sequence <CR><LF>.<CR><LF>.
+# Reject bare newlines from remote SMTP clients.
 #
-# This will cause problems for legitimate clients that send
+# This will cause problems for legitimate clients that send any
 # non\-standard line endings such as web applications, netcat, fax
 # machines, or load balancer health checks. Such clients need to be
 # excluded with smtpd_forbid_bare_newline_exclusions.
index 8b15e91e6479f461231a56afd08b7cb8d5293bc9..0f4ee68b9505ecee8333cfecaab7ba259aa6cf1d 100644 (file)
@@ -171,7 +171,8 @@ Available in Postfix version 3.9, 3.8.5, 3.7.10, 3.6.14,
 .IP "\fBcleanup_replace_stray_cr_lf (yes)\fR"
 Replace each stray <CR> or <LF> character in message
 content with a space character, to prevent outbound SMTP smuggling,
-and to make the evaluation of Postfix\-added DKIM etc.
+and to make the evaluation of Postfix\-added DKIM or other signatures
+independent from how a remote mail server handles such characters.
 .SH "BEFORE QUEUE MILTER CONTROLS"
 .na
 .nf
index b068d813386bc77aa7c6b63d254e072f51bcf5d3..750dea9ccf97fd7c04b8c74c2010e0a946c17d44 100644 (file)
@@ -871,8 +871,8 @@ command pipelining constraints.
 .PP
 Available in Postfix 3.9, 3.8.4, 3.7.9, 3.6.13, 3.5.23 and later:
 .IP "\fBsmtpd_forbid_bare_newline (Postfix >= 3.9: normalize)\fR"
-Reject or normalize commands and email message content when a
-remote SMTP client sends lines ending in <LF>.
+Reject or normalize commands and email message content when an
+SMTP client sends lines ending in <LF>.
 .IP "\fBsmtpd_forbid_bare_newline_exclusions ($mynetworks)\fR"
 Exclude the specified clients from smtpd_forbid_bare_newline
 enforcement.
index 8b9837a8b9f79baeacb3e68c4153fdf3ba761a41..783836108bd11444f4e75651c9d5db0f7d68d2e4 100755 (executable)
@@ -561,9 +561,9 @@ while (<>) {
     s;\bsmtpd_etrn_restrictions\b;<a href="postconf.5.html#smtpd_etrn_restrictions">$&</a>;g;
     s;\bsmtpd_expansion_filter\b;<a href="postconf.5.html#smtpd_expansion_filter">$&</a>;g;
     s;\bsmtpd_for[-</bB>]*\n*[ <bB>]*bidden_commands\b;<a href="postconf.5.html#smtpd_forbidden_commands">$&</a>;g;
-    s;\bsmtpd_for[-</bB>]*\n*[ <bB>]*bid_bare_newline\b;<a href="postconf.5.html#smtpd_forbid_bare_newline">$&</a>;g;
-    s;\bsmtpd_for[-</bB>]*\n*[ <bB>]*bid_bare_newline_reject_code\b;<a href="postconf.5.html#smtpd_forbid_bare_newline_reject_code">$&</a>;g;
-    s;\bsmtpd_for[-</bB>]*\n*[ <bB>]*bid_bare_newline_exclusions\b;<a href="postconf.5.html#smtpd_forbid_bare_newline_exclusions">$&</a>;g;
+    s;\bsmtpd_for[-</bB>]*\n*[ <bB>]*bid_bare_new[-</bB>]*\n*[ <bB>]*line\b;<a href="postconf.5.html#smtpd_forbid_bare_newline">$&</a>;g;
+    s;\bsmtpd_for[-</bB>]*\n*[ <bB>]*bid_bare_new[-</bB>]*\n*[ <bB>]*line_reject_code\b;<a href="postconf.5.html#smtpd_forbid_bare_newline_reject_code">$&</a>;g;
+    s;\bsmtpd_for[-</bB>]*\n*[ <bB>]*bid_bare_new[-</bB>]*\n*[ <bB>]*line_exclusions\b;<a href="postconf.5.html#smtpd_forbid_bare_newline_exclusions">$&</a>;g;
     s;\bcleanup_replace_stray_cr_lf\b;<a href="postconf.5.html#cleanup_replace_stray_cr_lf">$&</a>;g;
     s;\bsmtpd_for[-</bB>]*\n*[ <bB>]*bid_unauth_pipelining\b;<a href="postconf.5.html#smtpd_forbid_unauth_pipelining">$&</a>;g;
     s;\bsmtpd_hard_error_limit\b;<a href="postconf.5.html#smtpd_hard_error_limit">$&</a>;g;
index 2666d0fcce1b545c6e3c0f1bc1642953d0005e05..8aba13e4a5df9ebe4fd13f622799705cb220bd6a 100644 (file)
@@ -19057,35 +19057,33 @@ MinProtocol = TLSv1
 
 %PARAM smtpd_forbid_bare_newline Postfix &ge; 3.9: normalize
 
-<p> Reject or normalize commands and email message content when a
-remote SMTP client sends lines ending in &lt;LF&gt;. Such line
-endings are commonly allowed with UNIX-based SMTP servers, but they
-violate the RFC 5321 requirement that lines must end in
-&lt;CR&gt;&lt;LF&gt;. <.p>
+<p> Reject or normalize commands and email message content when an
+SMTP client sends lines ending in &lt;LF&gt;. Such line endings are
+commonly allowed with UNIX-based SMTP servers, but they violate the
+RFC 5321 requirement that lines must end in &lt;CR&gt;&lt;LF&gt;.
+</p>
 
 <p> Specify one of the following values (case does not matter): </p>
 
 <dl compact>
 
-<dt> <b>normalize</b> </dt> <dd> Maintain compatibility with legacy
-SMTP clients that send lines ending in the non-standard &lt;LF&gt;,
-and treat those line endings as if the client sent the standard
-&lt;CR&gt;&lt;LF&gt;. However, if an SMTP client sends any DATA
-content line ending in the standard &lt;CR&gt;&lt;LF&gt;, require
-the standard End-of-DATA form &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;,
-and skip non-standard End-of-DATA forms. <br> This may fail to
-receive email from legitimate SMTP clients that send non-standard
-line endings such web applications, netcat, fax machines, or load
-balancer health checks. Such clients need to be excluded with
-smtpd_forbid_bare_newline_exclusions. </dd>
+<dt> <b>normalize</b> (default)</dt> <dd> Require the standard
+End-of-DATA sequence &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;.
+Otherwise, maintain compatibility with legacy SMTP clients that
+send lines ending in the non-standard &lt;LF&gt;, and treat those
+line endings as if the client sent the standard &lt;CR&gt;&lt;LF&gt;.
+<br> This may fail to receive email from legitimate SMTP clients
+such web applications, netcat, fax machines, or load balancer health
+checks.  Such clients need to be excluded with
+smtpd_forbid_bare_newline_exclusions.  </dd>
 
 <dt> <b>yes</b> </dt> <dd> Alias for "normalize". </dd>
 
-<dt> <b>reject</b> </dt> <dd> When an SMTP client sends a command
-or message content line ending in &lt;LF&gt;, log a "bare &lt;LF&gt;
-received" error, reject the command or message content with
-smtpd_forbid_bare_newline_reject_code, and require the standard
-End-of-DATA form &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;. <br>
+<dt> <b>reject</b> </dt> <dd> Require the standard End-of-DATA
+sequence &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;. When an SMTP
+client sends a command or message content line ending in &lt;LF&gt;,
+log a "bare &lt;LF&gt; received" error, and reject the command or
+message content with $smtpd_forbid_bare_newline_reject_code. <br>
 This will fail to receive email from legitimate SMTP clients that
 send non-standard line endings such web applications, netcat, fax
 machines, or load balancer health checks. Such clients need to be
@@ -19104,14 +19102,13 @@ href="https://www.postfix.org/smtp-smuggling.html"> SMTP smuggling</a>.
 
 <blockquote>
 <pre>
-# Allow bare newlines from local and remote SMTP clients. If any DATA
-# content line ends in &lt;CR&gt;&lt;LF&gt;, require the standard End-of-DATA form
-# &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt; and skip other End-of-DATA forms.
+# Require the standard End-of-DATA sequence &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;.
+# Allow bare newlines from local and remote SMTP clients.
 #
-# This may cause problems for legitimate clients that send
-# non-standard line endings such as web applications, netcat, fax
-# machines, or load balancer health checks. Such clients need to be
-# excluded with smtpd_forbid_bare_newline_exclusions.
+# This will cause problems for legitimate clients that send a
+# non-standard End-of-DATA sequence such as web applications, netcat,
+# fax machines, or load balancer health checks. Such clients need
+# to be excluded with smtpd_forbid_bare_newline_exclusions.
 #
 smtpd_forbid_bare_newline = normalize
 smtpd_forbid_bare_newline_exclusions = $mynetworks
@@ -19120,10 +19117,10 @@ smtpd_forbid_bare_newline_exclusions = $mynetworks
 
 <blockquote>
 <pre>
-# Reject bare newlines from remote SMTP clients. Require the standard
-# End-of-DATA form &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;.
+# Require the standard End-of-DATA sequence &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;.
+# Reject bare newlines from remote SMTP clients.
 #
-# This will cause problems for legitimate clients that send
+# This will cause problems for legitimate clients that send any
 # non-standard line endings such as web applications, netcat, fax
 # machines, or load balancer health checks. Such clients need to be
 # excluded with smtpd_forbid_bare_newline_exclusions.
@@ -19162,7 +19159,7 @@ Specify a 5XX status code (521 to disconnect).
 
 <p> Replace each stray &lt;CR&gt; or &lt;LF&gt; character in message
 content with a space character, to prevent outbound SMTP smuggling,
-and to make the evaluation of Postfix-added DKIM etc. signatures
+and to make the evaluation of Postfix-added DKIM or other signatures
 independent from how a remote mail server handles such characters.
 </p>
 
index eac3c2538ec5cb31da5b6c7a5a44f64a3a199fd0..5db42bd85b22a7da1b0ab88dc074cdb1265e00c4 100644 (file)
 /* .IP "\fBcleanup_replace_stray_cr_lf (yes)\fR"
 /*     Replace each stray <CR> or <LF> character in message
 /*     content with a space character, to prevent outbound SMTP smuggling,
-/*     and to make the evaluation of Postfix-added DKIM etc.
+/*     and to make the evaluation of Postfix-added DKIM or other signatures
+/*     independent from how a remote mail server handles such characters.
 /* BEFORE QUEUE MILTER CONTROLS
 /* .ad
 /* .fi
index 7fbbb715d5cda073c28c54e45b83efd908a1decf..38d4cf83b4e10d3e9ddbf3ed6cc54f9c5125c0bf 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      "20240109"
+#define MAIL_RELEASE_DATE      "20240110"
 #define MAIL_VERSION_NUMBER    "3.9"
 
 #ifdef SNAPSHOT
index 6c94c67beb4e44566cd464b418c745d0224ecd39..b798f7bdee808124ed09737bbe8e7f21eaa7ce06 100644 (file)
 /* .PP
 /*     Available in Postfix 3.9, 3.8.4, 3.7.9, 3.6.13, 3.5.23 and later:
 /* .IP "\fBsmtpd_forbid_bare_newline (Postfix >= 3.9: normalize)\fR"
-/*     Reject or normalize commands and email message content when a
-/*     remote SMTP client sends lines ending in <LF>.
+/*     Reject or normalize commands and email message content when an
+/*     SMTP client sends lines ending in <LF>.
 /* .IP "\fBsmtpd_forbid_bare_newline_exclusions ($mynetworks)\fR"
 /*     Exclude the specified clients from smtpd_forbid_bare_newline
 /*     enforcement.
@@ -1656,8 +1656,8 @@ int     smtpd_hfrom_format;
 #define BARE_LF_FLAG_NORMALIZE (1<<0)  /* Best effort */
 #define BARE_LF_FLAG_REJECT    (1<<1)  /* Purist */
 
-#define IS_BARE_LF_NORMALIZE(m)        ((m) & BARE_LF_FLAG_NORMALIZE)
 #define IS_BARE_LF_REJECT(m)   ((m) & BARE_LF_FLAG_REJECT)
+#define IS_BARE_LF_DETECT(m)   ((m) != 0)
 
 static const NAME_CODE bare_lf_masks[] = {
     "normalize", BARE_LF_FLAG_NORMALIZE,
@@ -3623,7 +3623,7 @@ static void receive_data_message(SMTPD_STATE *state,
     int     prev_rec_type;
     int     first = 1;
     int     prev_detected_bare_lf = 0;
-    int     require_crlf_dot_crlf = IS_BARE_LF_REJECT(smtp_forbid_bare_lf);
+    int     require_crlf_dot_crlf = IS_BARE_LF_DETECT(smtp_forbid_bare_lf);
 
     /*
      * If deadlines are enabled, increase the time budget as message content
@@ -3645,9 +3645,6 @@ static void receive_data_message(SMTPD_STATE *state,
      * because sendmail permits it.
      */
     for (prev_rec_type = 0; /* void */ ; prev_rec_type = curr_rec_type,
-        require_crlf_dot_crlf = (require_crlf_dot_crlf ||
-                                 (IS_BARE_LF_NORMALIZE(smtp_forbid_bare_lf)
-                                  && smtp_detected_bare_lf == 0)),
         prev_detected_bare_lf = smtp_detected_bare_lf) {
        if (smtp_get(state->buffer, state->client, var_line_limit,
                     SMTP_GET_FLAG_NONE) == '\n')