]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.4.4-RC1 v2.4.4-RC1
authorWietse Venema <wietse@porcupine.org>
Thu, 14 Jun 2007 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sat, 10 Feb 2018 20:17:50 +0000 (15:17 -0500)
postfix/HISTORY
postfix/html/postconf.5.html
postfix/man/man5/postconf.5
postfix/proto/postconf.html.prolog
postfix/proto/postconf.man.prolog
postfix/src/global/mail_version.h
postfix/src/milter/milter8.c

index 462a94a5130e75e7a3e1a9cb2c9a0e1ef89cdfda..8c8350edef54aa3656451334986fc8ca62d2f66c 100644 (file)
@@ -13481,3 +13481,13 @@ Apologies for any names omitted.
        Portability: Victor helpfully pointed out that change
        20070425 broke on non-IPv6 systems. Files: smtpd/smtpd_peer.c,
        qmqpd/qmqpd_peer.c.
+
+20070613
+
+        Bugfix: the Milter client assumed that a Milter application
+        does not modify the message header or envelope, after that
+        same Milter application has modified the message body of
+        that same email message. This is not a problem with updates
+        by different Milter applications.  Problem was triggered
+        by Jose-Marcio Martins da Cruz. Also simplified the handling
+        of queue file update errors. File: milter/milter8.c.
index a2d5b12f04ba45d13f11307a02ed43159c2c8d55..3f5413544fc02d7e349915845435050496d6e3c9 100644 (file)
@@ -53,6 +53,8 @@ recursively replaced by the value of the named parameter. </p>
 "$name" is empty. This form is supported with Postfix version 2.2
 and later.  </p>
 
+<li> <p> Specify "$$" to produce a single "$" character. </p>
+
 </ul>
 
 <li> <p> When the same parameter is defined multiple times, only
index 7d56391ad83a9b251d4f2a7e4985c9796f286d84..60ac612d5181ec286d3b9fedb95aed1b3cf6c1fd 100644 (file)
@@ -42,6 +42,8 @@ version 2.2 and later.
 The expression "${name:value}" expands to "value" when
 "$name" is empty. This form is supported with Postfix
 version 2.2 and later.
+.IP \(bu
+Specify "$$" to produce a single "$" character.
 .RE
 .IP \(bu
 When the same parameter is defined multiple times, only the last
index 5b8c4806ff7104105f47f2cbfd0616712f2bda69..3963e7e6d5a3e2c5388640a99ff3afad2e20f644 100644 (file)
@@ -53,6 +53,8 @@ recursively replaced by the value of the named parameter. </p>
 "$name" is empty. This form is supported with Postfix version 2.2
 and later.  </p>
 
+<li> <p> Specify "$$" to produce a single "$" character. </p>
+
 </ul>
 
 <li> <p> When the same parameter is defined multiple times, only
index a3f50bf148eb5d80150e7460b6de5cc77f1327b1..37afa4e88fe98307ac19819fdd048d1f736cadc6 100644 (file)
@@ -42,6 +42,8 @@ version 2.2 and later.
 The expression "${name:value}" expands to "value" when
 "$name" is empty. This form is supported with Postfix
 version 2.2 and later.
+.IP \(bu
+Specify "$$" to produce a single "$" character.
 .RE
 .IP \(bu
 When the same parameter is defined multiple times, only the last
index 220e0fc814ca0d15e8df723724cf3a30e5423a10..7ec6309ed4e1d34602f2cc27fd0f22a4e4452021 100644 (file)
@@ -20,8 +20,8 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20070531"
-#define MAIL_VERSION_NUMBER    "2.4.3"
+#define MAIL_RELEASE_DATE      "20070614"
+#define MAIL_VERSION_NUMBER    "2.4.4-RC1"
 
 #ifdef SNAPSHOT
 # define MAIL_VERSION_DATE     "-" MAIL_RELEASE_DATE
index 2ccd7e74913657f8dfbde4db78bc67c35417f1eb..a3b2e364e3d54364aed07ddce5eda7d6db593c7f 100644 (file)
@@ -475,6 +475,28 @@ static int milter8_comm_error(MILTER8 *milter)
     return (milter->state = MILTER8_STAT_ERROR);
 }
 
+/* milter8_edit_error - local queue file update error */
+
+static void milter8_edit_error(MILTER8 *milter, const char *reply)
+{
+
+    /*
+     * Close the socket, so we don't have to skip pending replies from this
+     * Milter instance.
+     */
+    if (milter->fp != 0) {
+       (void) vstream_fclose(milter->fp);
+       milter->fp = 0;
+    }
+
+    /*
+     * Set the socket state to ERROR, so we don't try to send further MTA
+     * events to this Milter instance.
+     */
+    milter8_def_reply(milter, reply);
+    milter->state = MILTER8_STAT_ERROR;
+}
+
 /* milter8_close_stream - close stream to milter application */
 
 static void milter8_close_stream(MILTER8 *milter)
@@ -1002,6 +1024,27 @@ static const char *milter8_event(MILTER8 *milter, int event,
            msg_info("reply: %s data %ld bytes",
                     (smfir_name = str_name_code(smfir_table, cmd)) != 0 ?
                     smfir_name : "unknown", (long) data_size);
+
+       /*
+        * Handle unfinished message body replacement first.
+        */
+       if (body_line_buf != 0 && cmd != SMFIR_REPLBODY) {
+           /* In case the last body replacement line didn't end in CRLF. */
+           if (LEN(body_line_buf) > 0)
+               edit_resp = parent->repl_body(parent->chg_context,
+                                             MILTER_BODY_LINE,
+                                             body_line_buf);
+           if (edit_resp == 0)
+               edit_resp = parent->repl_body(parent->chg_context,
+                                             MILTER_BODY_END,
+                                             (VSTRING *) 0);
+           if (edit_resp) {
+               milter8_edit_error(milter, edit_resp);
+               MILTER8_EVENT_BREAK(milter->def_reply);
+           }
+           vstring_free(body_line_buf);
+           body_line_buf = 0;
+       }
        switch (cmd) {
 
            /*
@@ -1212,8 +1255,10 @@ static const char *milter8_event(MILTER8 *milter, int event,
                        edit_resp = parent->del_header(parent->chg_context,
                                                       (ssize_t) index,
                                                       STR(milter->buf));
-                   if (edit_resp)
-                       MILTER8_EVENT_BREAK(edit_resp);
+                   if (edit_resp) {
+                       milter8_edit_error(milter, edit_resp);
+                       MILTER8_EVENT_BREAK(milter->def_reply);
+                   }
                    continue;
 #endif
 
@@ -1229,8 +1274,10 @@ static const char *milter8_event(MILTER8 *milter, int event,
                    edit_resp = parent->add_header(parent->chg_context,
                                                   STR(milter->buf),
                                                   STR(milter->body));
-                   if (edit_resp)
-                       MILTER8_EVENT_BREAK(edit_resp);
+                   if (edit_resp) {
+                       milter8_edit_error(milter, edit_resp);
+                       MILTER8_EVENT_BREAK(milter->def_reply);
+                   }
                    continue;
 
                    /*
@@ -1257,8 +1304,10 @@ static const char *milter8_event(MILTER8 *milter, int event,
                                                   (ssize_t) index + 1,
                                                   STR(milter->buf),
                                                   STR(milter->body));
-                   if (edit_resp)
-                       MILTER8_EVENT_BREAK(edit_resp);
+                   if (edit_resp) {
+                       milter8_edit_error(milter, edit_resp);
+                       MILTER8_EVENT_BREAK(milter->def_reply);
+                   }
                    continue;
 #endif
 
@@ -1272,8 +1321,10 @@ static const char *milter8_event(MILTER8 *milter, int event,
                        MILTER8_EVENT_BREAK(milter->def_reply);
                    edit_resp = parent->add_rcpt(parent->chg_context,
                                                 STR(milter->buf));
-                   if (edit_resp)
-                       MILTER8_EVENT_BREAK(edit_resp);
+                   if (edit_resp) {
+                       milter8_edit_error(milter, edit_resp);
+                       MILTER8_EVENT_BREAK(milter->def_reply);
+                   }
                    continue;
 
                    /*
@@ -1286,8 +1337,10 @@ static const char *milter8_event(MILTER8 *milter, int event,
                        MILTER8_EVENT_BREAK(milter->def_reply);
                    edit_resp = parent->del_rcpt(parent->chg_context,
                                                 STR(milter->buf));
-                   if (edit_resp)
-                       MILTER8_EVENT_BREAK(edit_resp);
+                   if (edit_resp) {
+                       milter8_edit_error(milter, edit_resp);
+                       MILTER8_EVENT_BREAK(milter->def_reply);
+                   }
                    continue;
 
                    /*
@@ -1323,6 +1376,10 @@ static const char *milter8_event(MILTER8 *milter, int event,
                            VSTRING_ADDCH(body_line_buf, ch);
                        }
                    }
+                   if (edit_resp) {
+                       milter8_edit_error(milter, edit_resp);
+                       MILTER8_EVENT_BREAK(milter->def_reply);
+                   }
                    continue;
                }
            }
@@ -1348,35 +1405,11 @@ static const char *milter8_event(MILTER8 *milter, int event,
     }
 
     /*
-     * Finish message body replacement.
+     * Clean up after aborted message body replacement.
      */
-    if (body_line_buf != 0) {
-       if (edit_resp == 0) {
-           /* In case the last body replacement line didn't end in CRLF. */
-           if (LEN(body_line_buf) > 0)
-               edit_resp = parent->repl_body(parent->chg_context,
-                                             MILTER_BODY_LINE,
-                                             body_line_buf);
-           if (edit_resp == 0)
-               edit_resp = parent->repl_body(parent->chg_context,
-                                             MILTER_BODY_END,
-                                             (VSTRING *) 0);
-       }
+    if (body_line_buf)
        vstring_free(body_line_buf);
 
-       /*
-        * Override a non-reject/discard result value after body replacement
-        * failure.
-        * 
-        * XXX Some cleanup clients ask the cleanup server to bounce mail for
-        * them. In that case we must override a hard reject retval result
-        * after queue file update failure. This is not a big problem; the
-        * odds are small that a Milter application sends a hard reject after
-        * replacing the message body.
-        */
-       if (edit_resp && (retval == 0 || strchr("DS4", retval[0]) == 0))
-           retval = edit_resp;
-    }
     return (retval);
 }