]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.5-20070423
authorWietse Venema <wietse@porcupine.org>
Mon, 23 Apr 2007 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:33:06 +0000 (06:33 +0000)
postfix/HISTORY
postfix/html/pipe.8.html
postfix/man/man8/pipe.8
postfix/src/global/mail_version.h
postfix/src/pipe/pipe.c
postfix/src/trivial-rewrite/transport.c

index e2494e3714647b9e2680108509cdb4f24e909ce8..4ce416abb98734b61f04ac967b824d65d2de3532 100644 (file)
@@ -13460,6 +13460,12 @@ Apologies for any names omitted.
        is also responsible for "Delivered-To:" loop detection.
        File pipe/pipe.c.
 
+20070423
+
+       The cache expiring transport map lookups did not distinguish
+       between wildcard transport map entry with an "empty" transport
+       field, or no wildcard transport map entry.
+
 Wish list:
 
        Remove defer(8) and trace(8) references and man pages. These
index cf1210a0ca68f4e2f5a81bbe4641bb4dcb7c7846..ba1b42e7eee17ee3b827a02727cc8f5a3229a824 100644 (file)
@@ -91,8 +91,8 @@ PIPE(8)                                                                PIPE(8)
                      <b>nation_recipient_limit</b> must be 1  (see  SIN-
                      GLE-RECIPIENT DELIVERY above for details).
 
-                     This   code  also  enforces  loop  detection
-                     (Postfix  2.5  and  later).   If  a  message
+                     The  <b>D</b>  flag  also  enforces  loop detection
+                     (Postfix  2.5  and  later):  if  a   message
                      already contains a <b>Delivered-To:</b> header with
                      the same recipient address, then the message
                      is returned as undeliverable.
index 7b5a2c6758f09d5e028282a99118830b02ad6cb3..b18bf7329dcecba62830088df56be7300133abe8 100644 (file)
@@ -89,8 +89,8 @@ envelope recipient address. Note: for this to work, the
 \fItransport\fB_destination_recipient_limit\fR must be 1
 (see SINGLE-RECIPIENT DELIVERY above for details).
 .sp
-This code also enforces loop detection (Postfix 2.5 and later).
-If a message already contains a \fBDelivered-To:\fR header
+The \fBD\fR flag also enforces loop detection (Postfix 2.5 and later):
+if a message already contains a \fBDelivered-To:\fR header
 with the same recipient address, then the message is
 returned as undeliverable.
 .sp
index b5f4ec0d85275f16b9a5a845e10232a6fdc73ed8..84f5b3f4c17a36969109ac992cce9a5447d7970e 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      "20070422"
+#define MAIL_RELEASE_DATE      "20070423"
 #define MAIL_VERSION_NUMBER    "2.5"
 
 #ifdef SNAPSHOT
index ec163e15de9b2cd0e2f7c317a7ab6ec12323df25..4ecf4e609156e680b5b6b50d64bd185aa7eb14c5 100644 (file)
@@ -79,8 +79,8 @@
 /*     \fItransport\fB_destination_recipient_limit\fR must be 1
 /*     (see SINGLE-RECIPIENT DELIVERY above for details).
 /* .sp
-/*     This code also enforces loop detection (Postfix 2.5 and later).
-/*     If a message already contains a \fBDelivered-To:\fR header
+/*     The \fBD\fR flag also enforces loop detection (Postfix 2.5 and later):
+/*     if a message already contains a \fBDelivered-To:\fR header
 /*     with the same recipient address, then the message is
 /*     returned as undeliverable.
 /* .sp
index 7750a372bb30e317980059b188e4b89a538f3d97..09fd2ec035ed88ac966af3de5e697d39f7d5aa02 100644 (file)
@@ -100,8 +100,7 @@ TRANSPORT_INFO *transport_pre_init(const char *transport_maps_name,
     tp->transport_path = maps_create(transport_maps_name, transport_maps,
                                     DICT_FLAG_LOCK | DICT_FLAG_FOLD_FIX
                                     | DICT_FLAG_NO_REGSUB);
-    tp->wildcard_channel = vstring_alloc(10);
-    tp->wildcard_nexthop = vstring_alloc(10);
+    tp->wildcard_channel = tp->wildcard_nexthop = 0;
     tp->transport_errno = 0;
     tp->expire = 0;
     return (tp);
@@ -207,6 +206,18 @@ static int find_transport_entry(TRANSPORT_INFO *tp, const char *key,
 
 static void transport_wildcard_init(TRANSPORT_INFO *tp)
 {
+    VSTRING *channel = vstring_alloc(10);
+    VSTRING *nexthop = vstring_alloc(10);
+
+    /*
+     * Both channel and nexthop may be zero-length strings. Therefore we must
+     * use something else to represent "wild-card does not exist". We use
+     * null VSTRING pointers, for historical reasons.
+     */
+    if (tp->wildcard_channel)
+       vstring_free(tp->wildcard_channel);
+    if (tp->wildcard_nexthop)
+       vstring_free(tp->wildcard_nexthop);
 
     /*
      * Technically, the wildcard lookup pattern is redundant. A static map
@@ -222,18 +233,19 @@ static void transport_wildcard_init(TRANSPORT_INFO *tp)
 #define FULL           0
 #define PARTIAL                DICT_FLAG_FIXED
 
-    if (find_transport_entry(tp, WILDCARD, "", FULL,
-                            tp->wildcard_channel,
-                            tp->wildcard_nexthop)) {
+    if (find_transport_entry(tp, WILDCARD, "", FULL, channel, nexthop)) {
        tp->transport_errno = 0;
+       tp->wildcard_channel = channel;
+       tp->wildcard_nexthop = nexthop;
        if (msg_verbose)
            msg_info("wildcard_{chan:hop}={%s:%s}",
-                    vstring_str(tp->wildcard_channel),
-                    vstring_str(tp->wildcard_nexthop));
+                    vstring_str(channel), vstring_str(nexthop));
     } else {
        tp->transport_errno = dict_errno;
-       VSTRING_RESET(tp->wildcard_channel);
-       VSTRING_RESET(tp->wildcard_nexthop);
+       vstring_free(channel);
+       vstring_free(nexthop);
+       tp->wildcard_channel = 0;
+       tp->wildcard_nexthop = 0;
     }
     tp->expire = event_time() + 30;            /* XXX make configurable */
 }
@@ -325,7 +337,7 @@ int     transport_lookup(TRANSPORT_INFO *tp, const char *addr,
     if (tp->transport_errno) {
        dict_errno = tp->transport_errno;
        return (NOTFOUND);
-    } else if (tp->wildcard_channel && VSTRING_LEN(tp->wildcard_channel)) {
+    } else if (tp->wildcard_channel) {
        update_entry(STR(tp->wildcard_channel), STR(tp->wildcard_nexthop),
                     rcpt_domain, channel, nexthop);
        return (FOUND);