]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.9-20231222
authorWietse Venema <wietse@porcupine.org>
Fri, 22 Dec 2023 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <ietf-dane@dukhovni.org>
Thu, 21 Dec 2023 22:15:06 +0000 (17:15 -0500)
postfix/html/smtpd.8.html
postfix/man/man8/smtpd.8
postfix/src/global/mail_version.h
postfix/src/smtpd/smtpd.c

index 187af67f432ea9112d4183d14eda19949dee09e7..26ea40b95855be52d892e30996a077b2126dd0d6 100644 (file)
@@ -995,7 +995,7 @@ SMTPD(8)                                                              SMTPD(8)
               Disconnect remote SMTP clients that violate <a href="https://tools.ietf.org/html/rfc2920">RFC 2920</a>  (or  5321)
               command pipelining constraints.
 
-       Available in Postfix 3.9, 3.8.3, 3.7.9, 3.6.13, 3.5.23 and later:
+       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: yes)</b>
               Reply  with  "Error:  bare  &lt;LF&gt; received" and disconnect when a
index 1b6da42ad76caa03d682959cd939c36036cb4752..17b19695d1d44d0ef763cbdd8608c2812ab221b8 100644 (file)
@@ -869,7 +869,7 @@ Available in Postfix 3.9, 3.8.1, 3.7.6, 3.6.10, 3.5.20 and later:
 Disconnect remote SMTP clients that violate RFC 2920 (or 5321)
 command pipelining constraints.
 .PP
-Available in Postfix 3.9, 3.8.3, 3.7.9, 3.6.13, 3.5.23 and later:
+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: yes)\fR"
 Reply with "Error: bare <LF> received" and disconnect
 when a remote SMTP client sends a line ending in <LF>, violating
index a05e41ba704f6ed56f83f8f2394ba418e42edf43..da423cba187daf0be54950c4d170824540baeda7 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      "20231221"
+#define MAIL_RELEASE_DATE      "20231222"
 #define MAIL_VERSION_NUMBER    "3.9"
 
 #ifdef SNAPSHOT
index 342f5dfc71a3d2294c4b33f82d75828496a926da..6f83b36b61a6865077ada50c0d94b44ac4d9ed13 100644 (file)
 /*     Disconnect remote SMTP clients that violate RFC 2920 (or 5321)
 /*     command pipelining constraints.
 /* .PP
-/*     Available in Postfix 3.9, 3.8.3, 3.7.9, 3.6.13, 3.5.23 and later:
+/*     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: yes)\fR"
 /*     Reply with "Error: bare <LF> received" and disconnect
 /*     when a remote SMTP client sends a line ending in <LF>, violating
@@ -4079,7 +4079,7 @@ static int bdat_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
      */
     done = 0;
     do {
-       int     payload_err;
+       int     saved_forbid_bare_lf, last;
 
        /*
         * Do not skip the smtp_fread_buf() call if read_len == 0. We still
@@ -4093,21 +4093,20 @@ static int bdat_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
        smtp_fread_buf(state->buffer, read_len, state->client);
        state->bdat_get_stream = vstream_memreopen(
                           state->bdat_get_stream, state->buffer, O_RDONLY);
-       vstream_control(state->bdat_get_stream, CA_VSTREAM_CTL_EXCEPT,
-                       CA_VSTREAM_CTL_END);
-       if ((payload_err = vstream_setjmp(state->bdat_get_stream))
-           != SMTP_ERR_NONE)
-           vstream_longjmp(state->client, payload_err);
 
        /*
         * Read lines from the fragment. The last line may continue in the
-        * next fragment, or in the next chunk.
+        * next fragment, or in the next chunk. TODO(wietse) find out why a
+        * memory stream can't have vstream exceptions.
         */
        do {
-           if (smtp_get_noexcept(state->bdat_get_buffer,
-                                 state->bdat_get_stream,
-                                 var_line_limit,
-                                 SMTP_GET_FLAG_APPEND) == '\n') {
+           saved_forbid_bare_lf = smtp_forbid_bare_lf;
+           last = smtp_get_noexcept(state->bdat_get_buffer,
+                                    state->bdat_get_stream,
+                                    var_line_limit,
+                                    SMTP_GET_FLAG_APPEND);
+           smtp_forbid_bare_lf = saved_forbid_bare_lf;
+           if (last == '\n') {
                /* Stopped at end-of-line. */
                curr_rec_type = REC_TYPE_NORM;
            } else if (!vstream_feof(state->bdat_get_stream)) {