]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.11-20130513
authorWietse Venema <wietse@porcupine.org>
Mon, 13 May 2013 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Thu, 16 May 2013 05:36:31 +0000 (01:36 -0400)
24 files changed:
postfix/HISTORY
postfix/conf/access
postfix/conf/canonical
postfix/conf/virtual
postfix/html/access.5.html
postfix/html/canonical.5.html
postfix/html/postconf.5.html
postfix/html/virtual.5.html
postfix/man/man5/access.5
postfix/man/man5/canonical.5
postfix/man/man5/postconf.5
postfix/man/man5/virtual.5
postfix/proto/access
postfix/proto/canonical
postfix/proto/postconf.proto
postfix/proto/virtual
postfix/src/dns/dns_rr.c
postfix/src/global/mail_version.h
postfix/src/global/resolve_clnt.c
postfix/src/postscreen/postscreen.h
postfix/src/postscreen/postscreen_early.c
postfix/src/smtpd/smtpd_proxy.c
postfix/src/trivial-rewrite/resolve.c
postfix/src/util/poll_fd.c

index bc63c9114ee5d354239dd9918d4e9056d5fb6131..c09ee501728e2e09063fc41d4d83874073f118e8 100644 (file)
@@ -18432,6 +18432,32 @@ Apologies for any names omitted.
        src/smtpd/smtpd_check.c, src/trivial-rewrite/transport.c,
        src/trivial-rewrite/trivial-rewrite.c.
 
+20130409
+
+       Documentation: pointers to other actions under "ACCEPT
+       ACTIONS" and "REJECT ACTIONS". File: proto/access.
+
+20130410
+
+       Cleanup: more uniform permutation in dns_rr() by Victor
+       Duchovni & Son. File: dns/dns_rr.c.
+
+20130411
+
+       Documentation: clarified text about result formats. Files:
+       proto/canonical, proto/virtual.
+
+20130423
+
+       Bugfix (introduced: Postfix 2.0): when myhostname is not
+       listed in mydestination, the trivial-rewrite resolver may
+       log "do not list <myhostname value> in both mydestination
+       and <name of non-mydestination domain list>".  The fix is
+       to re-resolve a domain-less address after adding $myhostname
+       as the surrogate domain, so that it pops out with the right
+       address-class label.  Problem reported by Quanah Gibson-Mount.
+       File: trivial-rewrite/resolve.c.
+
 20130512
 
        Feature: allow an SMTP client to skip postscreen(8) tests
@@ -18441,3 +18467,15 @@ Apologies for any names omitted.
        postscreen/postscreen.c, postscreen/postscreen.h,
        postscreen/postscreen_early.c, postscreen/postscreen_state.c,
        postscreen/postscreen_tests.c.
+
+20130513
+
+       Bugfix (introduced: 20130512): postscreen logged no "PASS
+       NEW" event when the pregreet tests were turned off and the
+       postscreen_dnsbl_whitelist_treshold feature was turned on.
+       Reported by Rob McGee (/dev/rob0). Files: postscreen/postscreen.h,
+       postscreen/postscreen_early.c.
+
+       Bugfix (introduced: 20130512): postscreen panic because the
+       logic for dnsbl result retrieval was changed. Reported by
+       Noel Jones. File: postscreen/postscreen_early.c.
index 9df9991a4238ce978ae098977dfe7859ed6a59e5..cadc57d650278f21cccffe88a7c2169e8a512e5e 100644 (file)
 #               mat is generated by address-based relay  authoriza-
 #               tion schemes such as pop-before-smtp.
 # 
+#        For other accept actions, see "OTHER ACTIONS" below.
+# 
 # REJECT ACTIONS
 #        Postfix  version  2.3  and  later  support enhanced status
 #        codes as defined in RFC 3463.  When no code  is  specified
 # 
 #               This feature is available in Postfix 2.1 and later.
 # 
+#        For other reject actions, see "OTHER ACTIONS" below.
+# 
 # OTHER ACTIONS
 #        restriction...
 #               Apply the named UCE restriction(s) (permit, reject,
index 720db18ccc890d0d5e5ff66ac7c218b25812f937..fc0c821ad1c3ed04e3d41a6abcf7e9cac860eb2b 100644 (file)
@@ -66,9 +66,9 @@
 # TABLE FORMAT
 #        The input format for the postmap(1) command is as follows:
 # 
-#        pattern result
+#        pattern address
 #               When  pattern matches a mail address, replace it by
-#               the corresponding result.
+#               the corresponding address.
 # 
 #        blank lines and comments
 #               Empty lines and whitespace-only lines are  ignored,
index 3be6ab9859a5077edef2bc8be21bb8fae4a954c6..9f4b3d770fb593181f064548b7dc4d661f6940a7 100644 (file)
@@ -65,9 +65,9 @@
 # TABLE FORMAT
 #        The input format for the postmap(1) command is as follows:
 # 
-#        pattern result
+#        pattern address, address, ...
 #               When pattern matches a mail address, replace it  by
-#               the corresponding result.
+#               the corresponding address.
 # 
 #        blank lines and comments
 #               Empty  lines and whitespace-only lines are ignored,
index 0696fcdbfe10b53487192f6d97d91954656055a4..d191bd5617b10fd3f7541c96dc12ff92aba8a4f9 100644 (file)
@@ -184,6 +184,8 @@ ACCESS(5)                                                            ACCESS(5)
               mat is generated by address-based relay  authoriza-
               tion schemes such as pop-before-smtp.
 
+       For other accept actions, see "OTHER ACTIONS" below.
+
 <b>REJECT ACTIONS</b>
        Postfix  version  2.3  and  later  support enhanced status
        codes as defined in <a href="http://tools.ietf.org/html/rfc3463">RFC 3463</a>.  When no code  is  specified
@@ -254,6 +256,8 @@ ACCESS(5)                                                            ACCESS(5)
 
               This feature is available in Postfix 2.1 and later.
 
+       For other reject actions, see "OTHER ACTIONS" below.
+
 <b>OTHER ACTIONS</b>
        <i>restriction...</i>
               Apply the named UCE restriction(s) (<b>permit</b>, <b>reject</b>,
index c97f910ace308acabdb466a2d23ebf399d4d05b1..58c522cefc130ecfb9b349c952374d0ebc387aad 100644 (file)
@@ -52,7 +52,7 @@ CANONICAL(5)                                                      CANONICAL(5)
        <a href="postconf.5.html#remote_header_rewrite_domain">remote_header_rewrite_domain</a> configuration parameter spec-
        ifies a non-empty value. To get the behavior before  Post-
        fix    2.2,    specify   "<a href="postconf.5.html#local_header_rewrite_clients">local_header_rewrite_clients</a>   =
-       static:all".
+       <a href="DATABASE_README.html#types">static</a>:all".
 
        Typically, one would use the <a href="canonical.5.html"><b>canonical</b>(5)</a> table to replace
        login   names   by  <i>Firstname.Lastname</i>,  or  to  clean  up
@@ -72,9 +72,9 @@ CANONICAL(5)                                                      CANONICAL(5)
 <b>TABLE FORMAT</b>
        The input format for the <a href="postmap.1.html"><b>postmap</b>(1)</a> command is as follows:
 
-       <i>pattern result</i>
+       <i>pattern address</i>
               When  <i>pattern</i> matches a mail address, replace it by
-              the corresponding <i>result</i>.
+              the corresponding <i>address</i>.
 
        blank lines and comments
               Empty lines and whitespace-only lines are  ignored,
index 426601d76414f6b4c94b6cdf5fcee45e5aa41c39..fbddb59c3e8242a67f8256c241d44400e3d559da 100644 (file)
@@ -8567,7 +8567,7 @@ recipient_delimiters = +-
 # Use .forward for mail without address extension, and for mail with
 # an unrecognized address extension.
 <a href="postconf.5.html#forward_path">forward_path</a> = $home/.forward${<a href="postconf.5.html#recipient_delimiter">recipient_delimiter</a>}${extension},
-    $home/.forward,
+    $home/.forward
 </pre>
 
 
index 5306885f21b6539a5bd9ecdbe407b4a66cd00d83..e27077d0ec6bdb7e312e2e03ffceacb806bdb8e3 100644 (file)
@@ -71,9 +71,9 @@ VIRTUAL(5)                                                          VIRTUAL(5)
 <b>TABLE FORMAT</b>
        The input format for the <a href="postmap.1.html"><b>postmap</b>(1)</a> command is as follows:
 
-       <i>pattern result</i>
+       <i>pattern address, address, ...</i>
               When <i>pattern</i> matches a mail address, replace it  by
-              the corresponding <i>result</i>.
+              the corresponding <i>address</i>.
 
        blank lines and comments
               Empty  lines and whitespace-only lines are ignored,
index 64d678ad5e60d0b7e18f8125ceceaa191e9bf790..c1f45ae5872dbb908e409034a28b3e42e44db1d4 100644 (file)
@@ -172,6 +172,8 @@ Accept the address etc. that matches the pattern.
 An all-numerical result is treated as OK. This format is
 generated by address-based relay authorization schemes
 such as pop-before-smtp.
+.PP
+For other accept actions, see "OTHER ACTIONS" below.
 .SH "REJECT ACTIONS"
 .na
 .nf
@@ -237,6 +239,8 @@ response message.
 Prior to Postfix 2.6, the SMTP reply code is 450.
 .sp
 This feature is available in Postfix 2.1 and later.
+.PP
+For other reject actions, see "OTHER ACTIONS" below.
 .SH "OTHER ACTIONS"
 .na
 .nf
index 1bf8d53ebdd811f58a00c75c6a10c2f3cc3d1a5e..edf2a306fcb7c2b121b40d0ab15189aed84f7e3d 100644 (file)
@@ -73,9 +73,9 @@ lookup fields can match both upper and lower case.
 .ad
 .fi
 The input format for the \fBpostmap\fR(1) command is as follows:
-.IP "\fIpattern result\fR"
+.IP "\fIpattern address\fR"
 When \fIpattern\fR matches a mail address, replace it by the
-corresponding \fIresult\fR.
+corresponding \fIaddress\fR.
 .IP "blank lines and comments"
 Empty lines and whitespace-only lines are ignored, as
 are lines whose first non-whitespace character is a `#'.
index 54d1263117d52edc641b19e718d351b720a10704..24013f4a6134dbdb233d91512890d22f8bc25fdb 100644 (file)
@@ -5165,7 +5165,7 @@ recipient_delimiters = +-
 # Use .forward for mail without address extension, and for mail with
 # an unrecognized address extension.
 forward_path = $home/.forward${recipient_delimiter}${extension},
-    $home/.forward,
+    $home/.forward
 .fi
 .ad
 .ft R
index da139f8a1d92bc7b6655918ba162125b7da28e20..a8c80ecd4f0e079a22279eb18a64e864e756d9cd 100644 (file)
@@ -71,9 +71,9 @@ lookup fields can match both upper and lower case.
 .ad
 .fi
 The input format for the \fBpostmap\fR(1) command is as follows:
-.IP "\fIpattern result\fR"
+.IP "\fIpattern address, address, ...\fR"
 When \fIpattern\fR matches a mail address, replace it by the
-corresponding \fIresult\fR.
+corresponding \fIaddress\fR.
 .IP "blank lines and comments"
 Empty lines and whitespace-only lines are ignored, as
 are lines whose first non-whitespace character is a `#'.
index 403e080d1a52c6c2aa77d6e3ddcd0227f44264c3..12b56a378269048f4ff87712c3d79457ae3e57e9 100644 (file)
 #      An all-numerical result is treated as OK. This format is
 #      generated by address-based relay authorization schemes
 #      such as pop-before-smtp.
+# .PP
+#      For other accept actions, see "OTHER ACTIONS" below.
 # REJECT ACTIONS
 # .ad
 # .fi
 #      Prior to Postfix 2.6, the SMTP reply code is 450.
 # .sp
 #      This feature is available in Postfix 2.1 and later.
+# .PP
+#      For other reject actions, see "OTHER ACTIONS" below.
 # OTHER ACTIONS
 # .ad
 # .fi
index cdda9181845a76ae95e7a57cb367bb6e16e087d4..6fb534816036d974374f52c10c2e6e4c74aa1009 100644 (file)
@@ -63,9 +63,9 @@
 # .ad
 # .fi
 #      The input format for the \fBpostmap\fR(1) command is as follows:
-# .IP "\fIpattern result\fR"
+# .IP "\fIpattern address\fR"
 #      When \fIpattern\fR matches a mail address, replace it by the
-#      corresponding \fIresult\fR.
+#      corresponding \fIaddress\fR.
 # .IP "blank lines and comments"
 #      Empty lines and whitespace-only lines are ignored, as
 #      are lines whose first non-whitespace character is a `#'.
index 35ca415555958463e8eb5907722d5efb7ac7c150..4cbe12e58dd402734ba2d8a4e7b0384694692a11 100644 (file)
@@ -3547,7 +3547,7 @@ recipient_delimiters = +-
 # Use .forward for mail without address extension, and for mail with
 # an unrecognized address extension.
 forward_path = $home/.forward${recipient_delimiter}${extension},
-    $home/.forward,
+    $home/.forward
 </pre>
 
 %PARAM reject_code 554
index 8a2d28f607dbecab1be42a873e95ce13df07e4f3..fd98e2d48509c0495654c66d041d843174cd9942 100644 (file)
@@ -61,9 +61,9 @@
 # .ad
 # .fi
 #      The input format for the \fBpostmap\fR(1) command is as follows:
-# .IP "\fIpattern result\fR"
+# .IP "\fIpattern address, address, ...\fR"
 #      When \fIpattern\fR matches a mail address, replace it by the
-#      corresponding \fIresult\fR.
+#      corresponding \fIaddress\fR.
 # .IP "blank lines and comments"
 #      Empty lines and whitespace-only lines are ignored, as
 #      are lines whose first non-whitespace character is a `#'.
index 1e566949d1421c7b59d99a1c359fba0380403be6..8804cfd97756f9b60ab26e70a6fc8bd575a2bacf 100644 (file)
@@ -303,10 +303,12 @@ DNS_RR *dns_rr_shuffle(DNS_RR *list)
        rr_array[len] = rr;
 
     /*
-     * Shuffle resource records.
+     * Shuffle resource records. Every element has an equal chance of landing
+     * in slot 0.  After that every remaining element has an equal chance of
+     * landing in slot 1, ...  This is exactly n! states for n! permutations.
      */
-    for (i = 0; i < len; i++) {
-       r = myrand() % len;
+    for (i = 0; i < len - 1; i++) {
+       r = i + (myrand() % (len - i));         /* Victor&Son */
        rr = rr_array[i];
        rr_array[i] = rr_array[r];
        rr_array[r] = rr;
index 5245a0958563d4810753e6d9dab6bd5451bb103f..89fb80222e807239744260b37c5e5be2a318e50f 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      "20130512"
+#define MAIL_RELEASE_DATE      "20130513"
 #define MAIL_VERSION_NUMBER    "2.11"
 
 #ifdef SNAPSHOT
index bbd1b9b3a6755c6aa7b7617b5805757002edfaf4..5b28772c16776829ab0a4dd18571c0e7560c39e9 100644 (file)
@@ -386,8 +386,11 @@ int     main(int argc, char **argv)
        VSTRING *buffer = vstring_alloc(1);
 
        while (vstring_fgets_nonl(buffer, VSTREAM_IN)) {
-           if ((addr = split_at(STR(buffer), ' ')) == 0 || *STR(buffer) == 0)
-               msg_fatal("need as input: class address");
+           addr = split_at(STR(buffer), ' ');
+           if (*STR(buffer) == 0)
+               msg_fatal("need as input: class [address]");
+           if (addr == 0)
+               addr = "";
            resolve(STR(buffer), addr, &reply);
        }
        vstring_free(buffer);
index beb725fbbdddd68aed9e73d3e30892b2fcaf1aba..ebc048a0225ccd5d8c40ff2bdc54c5c9d7206dab 100644 (file)
@@ -232,6 +232,9 @@ typedef struct {
 #define PSC_STATE_MASK_BARLF_TODO_SKIP \
        (PSC_STATE_FLAG_BARLF_TODO | PSC_STATE_FLAG_BARLF_SKIP)
 
+#define PSC_STATE_MASK_PREGR_FAIL_DONE \
+       (PSC_STATE_FLAG_PREGR_FAIL | PSC_STATE_FLAG_PREGR_DONE)
+
 #define PSC_STATE_MASK_PIPEL_TODO_PASS_FAIL \
        (PSC_STATE_MASK_PIPEL_TODO_FAIL | PSC_STATE_FLAG_PIPEL_PASS)
 #define PSC_STATE_MASK_NSMTP_TODO_PASS_FAIL \
index 54f0a5789903c4ad4ffe69808f43a49825609fea..265bc0839a587c757aeffd535a1ed430258e4fe1 100644 (file)
@@ -89,8 +89,8 @@ static void psc_early_event(int event, char *context)
        /*
         * Check if the SMTP client spoke before its turn.
         */
-       if ((state->flags & PSC_STATE_MASK_PREGR_TODO_FAIL)
-           == (state->flags & PSC_STATE_MASK_PREGR_TODO_DONE)) {
+       if ((state->flags & PSC_STATE_FLAG_PREGR_TODO) != 0
+           && (state->flags & PSC_STATE_MASK_PREGR_FAIL_DONE) == 0) {
            state->pregr_stamp = event_time() + var_psc_pregr_ttl;
            PSC_PASS_SESSION_STATE(state, "pregreet test",
                                   PSC_STATE_FLAG_PREGR_PASS);
@@ -171,7 +171,8 @@ static void psc_early_event(int event, char *context)
        if ((read_count = recv(vstream_fileno(state->smtp_client_stream),
                          read_buf, sizeof(read_buf) - 1, MSG_PEEK)) <= 0) {
            /* Avoid memory leak. */
-           if (state->flags & PSC_STATE_FLAG_DNSBL_TODO)
+           if (state->dnsbl_score == NO_DNSBL_SCORE
+               && (state->flags & PSC_STATE_FLAG_DNSBL_TODO))
                (void) psc_dnsbl_retrieve(state->smtp_client_addr,
                                          &state->dnsbl_name,
                                          state->dnsbl_index);
@@ -188,7 +189,8 @@ static void psc_early_event(int event, char *context)
        switch (psc_pregr_action) {
        case PSC_ACT_DROP:
            /* Avoid memory leak. */
-           if (state->flags & PSC_STATE_FLAG_DNSBL_TODO)
+           if (state->dnsbl_score == NO_DNSBL_SCORE
+               && (state->flags & PSC_STATE_FLAG_DNSBL_TODO))
                (void) psc_dnsbl_retrieve(state->smtp_client_addr,
                                          &state->dnsbl_name,
                                          state->dnsbl_index);
index f77885436b1335427b2c1e326c20436dc427d9cd..aec8049745dd4c59683433dc7ff800a2c10c1401 100644 (file)
@@ -30,9 +30,6 @@
 /*     int     expect;
 /*     const char *format;
 /*
-/*     void    smtpd_proxy_disconnect(state)
-/*     SMTPD_STATE *state;
-/*
 /*     void    smtpd_proxy_free(state)
 /*     SMTPD_STATE *state;
 /*
 /*     In case of error, proxy->cmd() updates the state->error_mask
 /*     and state->err fields.
 /*
-/*     smtpd_proxy_disconnect() disconnects from a proxy server.
-/*     The last proxy server reply or error description remains
-/*     available via the proxy->buffer field.
-/*
 /*     smtpd_proxy_free() destroys a proxy server handle and resets
 /*     the state->proxy field.
 /*
index c0b6d9964cad33915f647247326b6dd87fa7a7d1..d9a709e30fad24eed739c6b792d2aa548bee7316 100644 (file)
@@ -324,9 +324,18 @@ static void resolve_addr(RES_CONTEXT *rp, char *sender, char *addr,
            tok822_free(tree->head);
            tree->head = 0;
        }
-       /* XXX must be localpart only, not user@domain form. */
-       if (tree->head == 0)
+       /* XXX Re-resolve the surrogate, in case already in user@domain form. */
+       if (tree->head == 0) {
            tree->head = tok822_scan(var_empty_addr, &tree->tail);
+           continue;
+       }
+
+       /* XXX Re-resolve with @$myhostname for backwards compatibility. */
+       if (domain == 0 && saved_domain == 0) {
+           tok822_sub_append(tree, tok822_alloc('@', (char *) 0));
+           tok822_sub_append(tree, tok822_scan(var_myhostname, (TOK822 **) 0));
+           continue;
+       }
 
        /*
         * We're done. There are no domains left to strip off the address,
index e8c7ed21f710bcb1a0986957d5cd99ab80b06126..80cd0f67daf70d63f46d4bf1766478d5c8c3547c 100644 (file)
@@ -27,8 +27,8 @@
 /*     int     true_res;
 /*     int     false_res;
 /* DESCRIPTION
-/*     The functions in this module are macros that provide a
-/*     convenient interface to poll_fd().
+/*     The read*() and write*() functions in this module are macros
+/*     that provide a convenient interface to poll_fd().
 /*
 /*     readable() asks the kernel if the specified file descriptor
 /*     is readable, i.e. a read operation would not block.
@@ -72,8 +72,8 @@
 /*     it is false. They never return an error indication.
 /*
 /*     read_wait() and write_wait() return zero when the requested
-/*     POLL_FD_READ or POLL_FD_WRITE condition is true, -1 with
-/*     errno set to ETIMEDOUT when it is false.
+/*     POLL_FD_READ or POLL_FD_WRITE condition is true, -1 (with
+/*     errno set to ETIMEDOUT) when it is false.
 /*
 /*     poll_fd() returns true_res when the requested POLL_FD_READ
 /*     or POLL_FD_WRITE condition is true, false_res when it is