]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.6-20081006
authorWietse Venema <wietse@porcupine.org>
Mon, 6 Oct 2008 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:34:12 +0000 (06:34 +0000)
13 files changed:
postfix/HISTORY
postfix/README_FILES/STRESS_README
postfix/RELEASE_NOTES
postfix/html/STRESS_README.html
postfix/proto/STRESS_README.html
postfix/src/cleanup/cleanup_envelope.c
postfix/src/global/dict_proxy.c
postfix/src/global/mail_proto.h
postfix/src/global/mail_version.h
postfix/src/oqmgr/qmgr_message.c
postfix/src/qmgr/qmgr_message.c
postfix/src/qmqpd/qmqpd.c
postfix/src/smtpd/smtpd.c

index 76772ac855b06690f391f1810e29e91e73832b96..f78a25e968cd7a140e427be4bb9865ff47beee2e 100644 (file)
@@ -14683,3 +14683,15 @@ Apologies for any names omitted.
        The XFORWARD specification of the ADDR attribute did not
        agree with the actual on-the-wire protocol. The spec has
        been updated. File: proto/XFORWARD_README.html.
+
+20081006
+
+       Further refinements to the handling of remote client
+       attributes.  Introduced a dummy "we have forwarded client
+       info" record, to eliminate the need for the backwards
+       incompatible queue file change that was introduced 20081003.
+       Files: smtpd/smtpd.c, cleanup/cleanup_envelope.c,
+       *qmgr/qmgr_message.c.
+
+       Hardened the proxymap client, in case it ever ends up in
+       a set-gid program. File: global/dict_proxy.c.
index 11f519088d4c0975a5bed4353538fc423cf1fc8c..576613726290106bf60eea89ca5dce5873900c6e 100644 (file)
@@ -122,7 +122,7 @@ S\bSp\bpe\ben\bnd\bd l\ble\bes\bss\bs t\bti\bim\bme\be p\bpe\ber\br S\bSM\bMT\bTP\bP c\bcl\bli\bie\ben\bn
 When increasing the number of SMTP server processes is not practical, you can
 improve Postfix server responsiveness by eliminating unnecessary work. When
 Postfix spends less time per SMTP session, the same number of SMTP server
-processes can service more clients.
+processes can service more clients in the same amount of time.
 
   * Eliminate non-functional RBL lookups (blocklists that are no longer in
     operation). These lookups can degrade performance. Postfix logs a warning
index 19c4d689cbe6d75014e52a2d9371ae0f8fb337c4..58fd83e58203a58b51517afa12b04c445cad6cd0 100644 (file)
@@ -24,19 +24,6 @@ with a remote submission from a client with an unknown hostname,
 the $client_hostname attribute now correctly expands into "unknown"
 instead of the empty string.
 
-There is a minor change in the way that XFORWARD attributes are
-stored in queue files. These attributes are used to propagate remote
-client information through an SMTP-based content filter. If you
-don't use such filters, then the following incompatibility does not
-affect your system.
-
-If you downgrade from this Postfix version to an older version while
-you still have new local submissions in the mail queue, the older
-Postfix cleanup server may log "spurious null attribute value"
-warnings when it processes queue files from the newer Postfix
-version.  The older cleanup server will ignore the null-valued
-attributes. Thus, no harm will be done.
-
 Incompatibility with snapshot 20080814
 ======================================
 
index 4803d5388ab958cce119ef3bc796cb85871962bf..809f1c4f3e5c174eabbfdbdffb0d6102c2066972 100644 (file)
@@ -182,7 +182,8 @@ Issue a "postfix reload" command to make the change effective.  </p>
 <p> When increasing the number of SMTP server processes is not
 practical, you can improve Postfix server responsiveness by eliminating
 unnecessary work. When Postfix spends less time per SMTP session, the
-same number of SMTP server processes can service more clients. </p>
+same number of SMTP server processes can service more clients in the
+same amount of time. </p>
 
 <ul>
 
index bedbf465c72825abeef83ca2504878452ca9e5dd..32744ffd2cc046524aa0f24ffc3630b68bb07d2d 100644 (file)
@@ -182,7 +182,8 @@ Issue a "postfix reload" command to make the change effective.  </p>
 <p> When increasing the number of SMTP server processes is not
 practical, you can improve Postfix server responsiveness by eliminating
 unnecessary work. When Postfix spends less time per SMTP session, the
-same number of SMTP server processes can service more clients. </p>
+same number of SMTP server processes can service more clients in the
+same amount of time. </p>
 
 <ul>
 
index 2e91df4d0455dacbdb28c1b2d2e437a7897a42c0..4a7b8cd1a7984f02b02612c244715e5f3c8dabc5 100644 (file)
@@ -176,14 +176,11 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type,
            state->errs |= CLEANUP_STAT_BAD;
            return;
        }
-#if 0
-       /* Zero-length values are place holders for unavailable values. */
        if (*attr_value == 0) {
            msg_warn("%s: spurious null attribute value for \"%s\" -- ignored",
                     state->queue_id, attr_name);
            return;
        }
-#endif
        if ((junk = rec_attr_map(attr_name)) != 0) {
            mapped_buf = attr_value;
            mapped_type = junk;
@@ -468,9 +465,7 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type,
                return;
            }
        }
-       /* Zero-length values are place holders for non-existent values. */
-       if (*attr_value)
-           nvtable_update(state->attr, attr_name, attr_value);
+       nvtable_update(state->attr, attr_name, attr_value);
        cleanup_out(state, type, buf, len);
        return;
     } else {
index 78a5dd73e520a08abc9d9525e7486afd372c33e4..5d0a11a611614e512d035abdb3bb9f18400f427c 100644 (file)
@@ -308,7 +308,7 @@ DICT   *dict_proxy_open(const char *map, int open_flags, int dict_flags)
     int     server_flags;
     int     status;
     const char *service;
-    char   *relative_path;
+    char   *chroot_path;
     char   *kludge = 0;
     char   *prefix;
     CLNT_STREAM **pstream;
@@ -342,10 +342,10 @@ DICT   *dict_proxy_open(const char *map, int open_flags, int dict_flags)
                  map, DICT_TYPE_PROXY);
 
     if (*pstream == 0) {
-       relative_path = concatenate(MAIL_CLASS_PRIVATE "/",
+       chroot_path = concatenate("/" MAIL_CLASS_PRIVATE "/",
                                    service, (char *) 0);
-       if (access(relative_path, F_OK) == 0)
-           prefix = MAIL_CLASS_PRIVATE;
+       if (access(chroot_path, F_OK) == 0)
+           prefix = "/" MAIL_CLASS_PRIVATE;
        else
            prefix = kludge = concatenate(var_queue_dir, "/",
                                          MAIL_CLASS_PRIVATE, (char *) 0);
@@ -353,7 +353,7 @@ DICT   *dict_proxy_open(const char *map, int open_flags, int dict_flags)
                                      var_ipc_ttl_limit);
        if (kludge)
            myfree(kludge);
-       myfree(relative_path);
+       myfree(chroot_path);
     }
 
     /*
index 2515952148afe2252febc5bf6cffbc695e2f6743..a3a9fde6a80efed01c125ccc4d4a39dea094a8ac 100644 (file)
@@ -174,7 +174,7 @@ extern char *mail_pathname(const char *, const char *);
 #define MAIL_ATTR_LOG_CLIENT_PORT "log_client_port"    /* client port */
 #define MAIL_ATTR_LOG_HELO_NAME        "log_helo_name" /* SMTP helo name */
 #define MAIL_ATTR_LOG_PROTO_NAME "log_protocol_name"   /* SMTP/ESMTP/QMQP */
-#define MAIL_ATTR_LOG_ORIGIN   "log_message_origin"    /* name[addr]:port */
+#define MAIL_ATTR_LOG_CLIENT_DUMMY "log_client_dummy"  /* none of the above */
 
 #define MAIL_ATTR_ACT_CLIENT   "client"/* client name addr */
 #define MAIL_ATTR_ACT_CLIENT_NAME "client_name"        /* client name */
@@ -187,6 +187,11 @@ extern char *mail_pathname(const char *, const char *);
 #define MAIL_ATTR_ACT_FORWARD_CLIENT_NAME "forward_client_name"
 
 #define MAIL_ATTR_PROTO_STATE  "protocol_state"        /* MAIL/RCPT/... */
+
+ /*
+  * Local submissions do not provide an origin record.
+  */
+#define MAIL_ATTR_LOG_ORIGIN   "log_message_origin"    /* name[addr]:port */
 #define MAIL_ATTR_ORG_NONE     "unknown"       /* origin unknown */
 #define MAIL_ATTR_ORG_LOCAL    "local" /* local submission */
 
index 06af0b44dd6fbb6d956b9c169088e3636a8be05e..2c22d40fdd8c76e59d0e4b03c257bd874f40830a 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      "20081005"
+#define MAIL_RELEASE_DATE      "20081006"
 #define MAIL_VERSION_NUMBER    "2.6"
 
 #ifdef SNAPSHOT
index b3a7b15a1e106adcf65510be8d066f081d17b6c1..8d738d4b74831176707b2880fffaa9cba3892213 100644 (file)
@@ -662,6 +662,8 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
                    myfree(message->client_helo);
                message->client_helo = mystrdup(value);
                have_log_client_attr = 1;
+           } else if (strcmp(name, MAIL_ATTR_LOG_CLIENT_DUMMY) == 0) {
+               have_log_client_attr = 1;
            } else if (strcmp(name, MAIL_ATTR_SASL_METHOD) == 0) {
                if (message->sasl_method == 0)
                    message->sasl_method = mystrdup(value);
index 24a981ed701f20d4b1f1433c166840e87f08847a..4b1a26d9cfb7ef16cea3f5e8e4353b87b079c112 100644 (file)
@@ -703,6 +703,8 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
                    myfree(message->client_helo);
                message->client_helo = mystrdup(value);
                have_log_client_attr = 1;
+           } else if (strcmp(name, MAIL_ATTR_LOG_CLIENT_DUMMY) == 0) {
+               have_log_client_attr = 1;
            } else if (strcmp(name, MAIL_ATTR_SASL_METHOD) == 0) {
                if (message->sasl_method == 0)
                    message->sasl_method = mystrdup(value);
index a4d1a00a13c9842859cd047439b18066f83b7b63..30bc49d7b1f859567302536843c6719430df1420 100644 (file)
@@ -334,12 +334,15 @@ static void qmqpd_write_attributes(QMQPD_STATE *state)
      */
     rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
                MAIL_ATTR_ACT_CLIENT_NAME, state->name);
+    /* XXX Backwards compatibility: include IPv6: prefix. */
     rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
                MAIL_ATTR_ACT_CLIENT_ADDR, state->rfc_addr);
     rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
                MAIL_ATTR_ACT_CLIENT_PORT, state->port);
     rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%u",
                MAIL_ATTR_ACT_CLIENT_AF, state->addr_family);
+    rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
+                MAIL_ATTR_ACT_PROTO_NAME, state->protocol);
 }
 
 /* qmqpd_copy_recipients - copy message recipients */
index 340d504ae4f0c0ae3a092f3d71a0f72d107d8e8d..e558147065d82bff8b00e0c8f04cb31e59b17e6e 100644 (file)
@@ -1776,6 +1776,8 @@ static int mail_open_stream(SMTPD_STATE *state)
                    /* XXX Backwards compatibility: include IPv6: prefix. */
                    rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
                       MAIL_ATTR_LOG_CLIENT_ADDR, state->xforward.rfc_addr);
+                   rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
+                            MAIL_ATTR_LOG_ORIGIN, state->xforward.namaddr);
                    rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
                           MAIL_ATTR_LOG_CLIENT_PORT, state->xforward.port);
                    if (state->xforward.helo_name)
@@ -1786,16 +1788,13 @@ static int mail_open_stream(SMTPD_STATE *state)
                } else {
                    /* Local submission. See also qmgr_message_read(). */
                    rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
-                        MAIL_ATTR_LOG_CLIENT_ADDR, MAIL_ATTR_VAL_NONEXIST);
+                               MAIL_ATTR_LOG_CLIENT_DUMMY, "dummy");
                }
+           } else {
+               rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
+                           MAIL_ATTR_LOG_ORIGIN, state->namaddr);
            }
 
-           /*
-            * Logging attribute for the Postfix 2.3+ cleanup server.
-            */
-           rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s",
-                       MAIL_ATTR_LOG_ORIGIN, FORWARD_NAMADDR(state));
-
            /*
             * Attributes with actual client information. These are used by
             * the smtpd Milter client for policy decisions. Mail that is