]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.9-20231224
authorWietse Venema <wietse@porcupine.org>
Sun, 24 Dec 2023 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <ietf-dane@dukhovni.org>
Fri, 22 Dec 2023 03:21:15 +0000 (22:21 -0500)
postfix/HISTORY
postfix/src/global/mail_version.h
postfix/src/smtpd/smtpd.c

index 1de5eaac2e6c248ddb43f6c4bf74a7c9267c4e9a..380b8776547901e9cf5b913a443698dea2d40651 100644 (file)
@@ -27643,3 +27643,18 @@ Apologies for any names omitted.
        "smtpd_forbid_bare_newline_exclusions = $mynetworks". Files:
        mantools/postlink, proto/postconf.proto, global/mail_params.h,
        global/smtp_stream.c, global/smtp_stream.h, smtpd/smtpd.c.
+
+20231222
+
+       Workaround: smtpd_forbid_bare_newline broke the BDAT command.
+       File: smtpd/smtpd.c.
+
+20231123
+
+       Bugfix: smtpd_forbid_bare_newline_exclusions should respect
+       XCLIENT overrides. File: smtpd/smtpd.c.
+
+20231224
+
+       Reverted change 20231221 and adopted a fix by Viktor. File:
+       smtpd/smtpd.c.
index d3ddc7f0d72ff711586e1731d26d23626b6fa269..97edb7eec679684a8f74a1d7c38965fe1f2f4db1 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      "20231223"
+#define MAIL_RELEASE_DATE      "20231224"
 #define MAIL_VERSION_NUMBER    "3.9"
 
 #ifdef SNAPSHOT
index fe3ba8de4dad7d25e75b1efd57a275cdbe4dd3de..f40070cc4939cadcfb6dd53b63d9b39ec4359de0 100644 (file)
@@ -4079,7 +4079,7 @@ static int bdat_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
      */
     done = 0;
     do {
-       int     saved_forbid_bare_lf, last;
+       int     payload_err;
 
        /*
         * Do not skip the smtp_fread_buf() call if read_len == 0. We still
@@ -4093,20 +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)) != 0)
+            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. TODO(wietse) find out why a
-        * memory stream can't have vstream exceptions.
+        * next fragment, or in the next chunk.
         */
        do {
-           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') {
+           if (smtp_get_noexcept(state->bdat_get_buffer,
+                                     state->bdat_get_stream,
+                                     var_line_limit,
+                                     SMTP_GET_FLAG_APPEND) == '\n') {
                /* Stopped at end-of-line. */
                curr_rec_type = REC_TYPE_NORM;
            } else if (!vstream_feof(state->bdat_get_stream)) {