]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.10.10 postfix-2.10 v2.10.10
authorWietse Venema <wietse@porcupine.org>
Fri, 15 May 2015 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sun, 15 May 2016 21:02:44 +0000 (17:02 -0400)
13 files changed:
postfix/HISTORY
postfix/conf/header_checks
postfix/html/header_checks.5.html
postfix/html/postscreen.8.html
postfix/man/man5/header_checks.5
postfix/man/man8/postscreen.8
postfix/proto/header_checks
postfix/src/cleanup/cleanup.h
postfix/src/cleanup/cleanup_addr.c
postfix/src/cleanup/cleanup_envelope.c
postfix/src/cleanup/cleanup_milter.c
postfix/src/global/mail_version.h
postfix/src/postscreen/postscreen.c

index 9346a519ee69dd54cdd06a4237cfb4b41db72fa3..e1f20bfcfe9ca2406223d0fd745a18dd9002d941 100644 (file)
@@ -18472,3 +18472,25 @@ Apologies for any names omitted.
        adding a header, because the PREPEND action used the same
        output function for header_checks and body_checks.  Viktor
        Dukhovni and Wietse. File: cleanup/cleanup_message.c.
+
+20160310
+
+       Bugfix (introduced: Postfix 2.6): the Milter SMFIR_CHGFROM
+       (replace sender) request lost the sender_bcc_maps address.
+       Fixed by moving some record keeping to the sender output
+       function.  Files: cleanup/cleanup_envelope.c,
+       cleanup/cleanup_addr.c, cleanup/cleanup_milter.c,
+       cleanup/cleanup.h, regression tests.
+
+20160410
+
+       Bugfix (introduced: Postfix 2.6): the "bad filetype"
+       header_checks pattern falsely rejected Content-Mumble headers
+       with ``name="example"; x-apple-part-url="example.com"''.
+       Fixed by respecting the ";" separator between content
+       attribute values.  Reported by Cedric Knight.  File:
+       proto/header_checks.
+
+20160515
+
+       Portability: OpenBSD 6.0. Files: makedefs, util/sys_defs.h.
index 490e214c7252cb350217c75e07f9a850c121373b..24b9adf7b5c6616c386a5c247f55f8cf6ae57ebe 100644 (file)
 #            header_checks = pcre:/etc/postfix/header_checks.pcre
 # 
 #        /etc/postfix/header_checks.pcre:
-#            /^Content-(Disposition|Type).*name\s*=\s*"?(.*(\.|=2E)(
+#            /^Content-(Disposition|Type).*name\s*=\s*"?([^;]*(\.|=2E)(
 #              ade|adp|asp|bas|bat|chm|cmd|com|cpl|crt|dll|exe|
 #              hlp|ht[at]|
 #              inf|ins|isp|jse?|lnk|md[betw]|ms[cipt]|nws|
index c1d2fe860c58c3607f1075f8121e652f2c75e5d8..93514300c7bfb51fdf432e28a1b36a998aef4729 100644 (file)
@@ -394,7 +394,7 @@ HEADER_CHECKS(5)                                              HEADER_CHECKS(5)
        are <b>From:</b>, <b>To:</b>, <b>Message-ID:</b>, <b>Date:</b>.
 
        Message headers deleted by the <a href="cleanup.8.html"><b>cleanup</b>(8)</a> daemon  will  be
-       examined before they are deleted. Examples are: <b>Bcc:Con-</b>
+       examined before they are deleted. Examples are: <b>Bcc:</b>, <b>Con-</b>
        <b>tent-Length:</b>, <b>Return-Path:</b>.
 
 <b>CONFIGURATION PARAMETERS</b>
@@ -451,7 +451,7 @@ HEADER_CHECKS(5)                                              HEADER_CHECKS(5)
            <a href="postconf.5.html#header_checks">header_checks</a> = <a href="pcre_table.5.html">pcre</a>:/etc/postfix/header_checks.pcre
 
        /etc/postfix/header_checks.<a href="pcre_table.5.html">pcre</a>:
-           /^Content-(Disposition|Type).*name\s*=\s*"?(.*(\.|=2E)(
+           /^Content-(Disposition|Type).*name\s*=\s*"?([^;]*(\.|=2E)(
              ade|adp|asp|bas|bat|chm|cmd|com|cpl|crt|dll|exe|
              hlp|ht[at]|
              inf|ins|isp|jse?|lnk|md[betw]|ms[cipt]|nws|
index 12f9b02f11ed98ec2b65555c608cceb20cab6217..1587f951a97b8addef943c84eec4a942cc4faf09 100644 (file)
@@ -88,9 +88,9 @@ POSTSCREEN(8)                                                    POSTSCREEN(8)
        The  optional  "after  220  server greeting" tests involve
        <a href="postscreen.8.html"><b>postscreen</b>(8)</a>'s built-in SMTP protocol engine. When  these
        tests succeed, <a href="postscreen.8.html"><b>postscreen</b>(8)</a> adds the client to the tempo-
-       rary whitelist, but it cannot not hand off the "live" con-
-       nection  to a Postfix SMTP server process in the middle of
-       a session.   Instead,  <a href="postscreen.8.html"><b>postscreen</b>(8)</a>  defers  attempts  to
+       rary whitelist, but it cannot hand off the "live"  connec-
+       tion  to  a Postfix SMTP server process in the middle of a
+       session.   Instead,  <a href="postscreen.8.html"><b>postscreen</b>(8)</a>  defers   attempts   to
        deliver  mail  with a 4XX status, and waits for the client
        to  disconnect.    When   the   client   connects   again,
        <a href="postscreen.8.html"><b>postscreen</b>(8)</a>  will  allow the client to talk to a Postfix
index 10cd89a00dabb48dbf63cfd72a351830f5a2e339..2ef1c486f88ea8abc098ea822e51ec65ce4b4eb5 100644 (file)
@@ -370,7 +370,7 @@ are excluded from inspection. Examples of such message headers
 are \fBFrom:\fR, \fBTo:\fR, \fBMessage-ID:\fR, \fBDate:\fR.
 
 Message headers deleted by the \fBcleanup\fR(8) daemon will
-be examined before they are deleted. Examples are: \fBBcc:\fr,
+be examined before they are deleted. Examples are: \fBBcc:\fR,
 \fBContent-Length:\fR, \fBReturn-Path:\fR.
 .SH "CONFIGURATION PARAMETERS"
 .na
@@ -422,7 +422,7 @@ sub-expressions is to recognize Windows CLSID strings.
     header_checks = pcre:/etc/postfix/header_checks.pcre
 
 /etc/postfix/header_checks.pcre:
-    /^Content-(Disposition|Type).*name\es*=\es*"?(.*(\e.|=2E)(
+    /^Content-(Disposition|Type).*name\es*=\es*"?([^;]*(\e.|=2E)(
       ade|adp|asp|bas|bat|chm|cmd|com|cpl|crt|dll|exe|
       hlp|ht[at]|
       inf|ins|isp|jse?|lnk|md[betw]|ms[cipt]|nws|
index 821748de83bdb3afea920e8a819c5eac21a76754..c3114d041e6fb673c13b744a27207465492b62c1 100644 (file)
@@ -93,7 +93,7 @@ traffic from dial-up and residential networks.
 The optional "after 220 server greeting" tests involve
 \fBpostscreen\fR(8)'s built-in SMTP protocol engine. When
 these tests succeed, \fBpostscreen\fR(8) adds the client
-to the temporary whitelist, but it cannot not hand off the
+to the temporary whitelist, but it cannot hand off the
 "live" connection to a Postfix SMTP server process in the
 middle of a session.  Instead, \fBpostscreen\fR(8) defers
 attempts to deliver mail with a 4XX status, and waits for
index b797e6b5ef7d3e41123f1e0a93b1972a6ce04bd7..2789e3852abd14e38e73ea1ec5d5c891086975bd 100644 (file)
 #      are \fBFrom:\fR, \fBTo:\fR, \fBMessage-ID:\fR, \fBDate:\fR.
 #
 #      Message headers deleted by the \fBcleanup\fR(8) daemon will
-#      be examined before they are deleted. Examples are: \fBBcc:\fr,
+#      be examined before they are deleted. Examples are: \fBBcc:\fR,
 #      \fBContent-Length:\fR, \fBReturn-Path:\fR.
 # CONFIGURATION PARAMETERS
 # .ad
 #          header_checks = pcre:/etc/postfix/header_checks.pcre
 #
 #      /etc/postfix/header_checks.pcre:
-#          /^Content-(Disposition|Type).*name\es*=\es*"?(.*(\e.|=2E)(
+#          /^Content-(Disposition|Type).*name\es*=\es*"?([^;]*(\e.|=2E)(
 #            ade|adp|asp|bas|bat|chm|cmd|com|cpl|crt|dll|exe|
 #            hlp|ht[at]|
 #            inf|ins|isp|jse?|lnk|md[betw]|ms[cipt]|nws|
index 6fff29511521adeafc73fe1992a2d2370fda6376..15ab05d1bcc37960e3f7d823f01aabce8149f74f 100644 (file)
@@ -283,7 +283,7 @@ extern void cleanup_out_recipient(CLEANUP_STATE *, const char *, int, const char
  /*
   * cleanup_addr.c.
   */
-extern void cleanup_addr_sender(CLEANUP_STATE *, const char *);
+extern off_t cleanup_addr_sender(CLEANUP_STATE *, const char *);
 extern void cleanup_addr_recipient(CLEANUP_STATE *, const char *);
 extern void cleanup_addr_bcc_dsn(CLEANUP_STATE *, const char *, const char *, int);
 
index 233ba37caee8a8b1b67fb036ef12f0f02aeae314..ba69777ce0bf19f5d1787693404607565055e1fe 100644 (file)
@@ -6,7 +6,7 @@
 /* SYNOPSIS
 /*     #include <cleanup.h>
 /*
-/*     void    cleanup_addr_sender(state, addr)
+/*     off_t   cleanup_addr_sender(state, addr)
 /*     CLEANUP_STATE *state;
 /*     const char *addr;
 /*
@@ -29,7 +29,8 @@
 /*     sender/recipient auto bcc address generation.
 /*
 /*     cleanup_addr_sender() processes sender envelope information and updates
-/*     state->sender.
+/*     state->sender. The result value is the offset of the record that
+/*     follows the sender record if milters are enabled, otherwise zero.
 /*
 /*     cleanup_addr_recipient() processes recipient envelope information
 /*     and updates state->recip.
@@ -85,6 +86,7 @@
 /* Global library. */
 
 #include <rec_type.h>
+#include <record.h>
 #include <cleanup_user.h>
 #include <mail_params.h>
 #include <ext_prop.h>
 #include "cleanup.h"
 
 #define STR                    vstring_str
+#define LEN                    VSTRING_LEN
 #define IGNORE_EXTENSION       (char **) 0
 
 /* cleanup_addr_sender - process envelope sender record */
 
-void    cleanup_addr_sender(CLEANUP_STATE *state, const char *buf)
+off_t   cleanup_addr_sender(CLEANUP_STATE *state, const char *buf)
 {
+    const char myname[] = "cleanup_addr_sender";
     VSTRING *clean_addr = vstring_alloc(100);
+    off_t   after_sender_offs = 0;
     const char *bcc;
+    size_t  len;
 
     /*
      * Note: an unqualified envelope address is for all practical purposes
@@ -142,6 +148,15 @@ void    cleanup_addr_sender(CLEANUP_STATE *state, const char *buf)
     if (state->sender)                         /* XXX Can't happen */
        myfree(state->sender);
     state->sender = mystrdup(STR(clean_addr)); /* Used by Milter client */
+    /* Fix 20160310: Moved from cleanup_envelope.c. */
+    if (state->milters || cleanup_milters) {
+       /* Make room to replace sender. */
+       if ((len = LEN(clean_addr)) < REC_TYPE_PTR_PAYL_SIZE)
+           rec_pad(state->dst, REC_TYPE_PTR, REC_TYPE_PTR_PAYL_SIZE - len);
+       /* Remember the after-sender record offset. */
+       if ((after_sender_offs = vstream_ftell(state->dst)) < 0)
+           msg_fatal("%s: vstream_ftell %s: %m:", myname, cleanup_path);
+    }
     if ((state->flags & CLEANUP_FLAG_BCC_OK)
        && *STR(clean_addr)
        && cleanup_send_bcc_maps) {
@@ -155,6 +170,7 @@ void    cleanup_addr_sender(CLEANUP_STATE *state, const char *buf)
        }
     }
     vstring_free(clean_addr);
+    return after_sender_offs;
 }
 
 /* cleanup_addr_recipient - process envelope recipient */
index 1f5aa51f11d27080f7fe6a3e4d2ee530de3322fb..61b312bfe201f3b5d9a6112a3a0d14fd45a19c85 100644 (file)
@@ -370,6 +370,8 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type,
        return;
     }
     if (type == REC_TYPE_FROM) {
+       off_t after_sender_offs;
+
        /* Allow only one instance. */
        if (state->sender != 0) {
            msg_warn("%s: message rejected: multiple envelope sender records",
@@ -382,14 +384,10 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type,
            if ((state->sender_pt_offset = vstream_ftell(state->dst)) < 0)
                msg_fatal("%s: vstream_ftell %s: %m:", myname, cleanup_path);
        }
-       cleanup_addr_sender(state, buf);
+       after_sender_offs = cleanup_addr_sender(state, buf);
        if (state->milters || cleanup_milters) {
-           /* Make room to replace sender. */
-           if ((len = strlen(state->sender)) < REC_TYPE_PTR_PAYL_SIZE)
-               rec_pad(state->dst, REC_TYPE_PTR, REC_TYPE_PTR_PAYL_SIZE - len);
            /* Remember the after-sender record offset. */
-           if ((state->sender_pt_target = vstream_ftell(state->dst)) < 0)
-               msg_fatal("%s: vstream_ftell %s: %m:", myname, cleanup_path);
+           state->sender_pt_target = after_sender_offs;
        }
        if (cleanup_milters != 0
            && state->milters == 0
index b0e642b542152e573f7672ecb63e495689bf7bb5..741a2bcddb3a4011221a57e17e9acaf4aa51b0a4 100644 (file)
@@ -1302,6 +1302,7 @@ static const char *cleanup_chg_from(void *context, const char *ext_from,
     const char *myname = "cleanup_chg_from";
     CLEANUP_STATE *state = (CLEANUP_STATE *) context;
     off_t   new_sender_offset;
+    off_t   after_sender_offs;
     int     addr_count;
     TOK822 *tree;
     TOK822 *tp;
@@ -1365,10 +1366,11 @@ static const char *cleanup_chg_from(void *context, const char *ext_from,
        }
     }
     tok822_free_tree(tree);
-    cleanup_addr_sender(state, STR(int_sender_buf));
+    after_sender_offs = cleanup_addr_sender(state, STR(int_sender_buf));
     vstring_free(int_sender_buf);
     cleanup_out_format(state, REC_TYPE_PTR, REC_TYPE_PTR_FORMAT,
                       (long) state->sender_pt_target);
+    state->sender_pt_target = after_sender_offs;
 
     /*
      * Overwrite the original sender record with the pointer to the new
@@ -2484,6 +2486,19 @@ int     main(int unused_argc, char **argv)
                var_milt_head_checks = mystrdup(argv->argv[1]);
                cleanup_milter_header_checks_init(state);
            }
+       } else if (strcmp(argv->argv[0], "sender_bcc_maps") == 0) {
+           if (argv->argc != 2) {
+               msg_warn("bad sender_bcc_maps argument count: %ld",
+                        (long) argv->argc);
+           } else {
+               if (cleanup_send_bcc_maps)
+                   maps_free(cleanup_send_bcc_maps);
+               cleanup_send_bcc_maps =
+                   maps_create("sender_bcc_maps", argv->argv[1],
+                               DICT_FLAG_LOCK | DICT_FLAG_FOLD_FIX);
+               state->flags |= CLEANUP_FLAG_BCC_OK;
+               var_rcpt_delim = "";
+           }
        } else {
            msg_warn("bad command: %s", argv->argv[0]);
        }
index 7393b5ece3e1315b58bf5abca6c3f8befa05c98a..2f5c62e29d0f2e5522537d6b2cf8a8c02520e12f 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      "20151010"
-#define MAIL_VERSION_NUMBER    "2.10.9"
+#define MAIL_RELEASE_DATE      "20150515"
+#define MAIL_VERSION_NUMBER    "2.10.10"
 
 #ifdef SNAPSHOT
 # define MAIL_VERSION_DATE     "-" MAIL_RELEASE_DATE
index 0149b59ad78dc302fe40d6048c15885a0189daee..b8fcf83449028f0c1853656f396778569ece7949 100644 (file)
@@ -79,7 +79,7 @@
 /*     The optional "after 220 server greeting" tests involve
 /*     \fBpostscreen\fR(8)'s built-in SMTP protocol engine. When
 /*     these tests succeed, \fBpostscreen\fR(8) adds the client
-/*     to the temporary whitelist, but it cannot not hand off the
+/*     to the temporary whitelist, but it cannot hand off the
 /*     "live" connection to a Postfix SMTP server process in the
 /*     middle of a session.  Instead, \fBpostscreen\fR(8) defers
 /*     attempts to deliver mail with a 4XX status, and waits for