]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.5.2-RC2 v2.5.2-RC2
authorWietse Venema <wietse@porcupine.org>
Fri, 11 Apr 2008 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sat, 10 Feb 2018 19:52:39 +0000 (14:52 -0500)
postfix/HISTORY
postfix/src/global/mail_version.h
postfix/src/oqmgr/qmgr_message.c
postfix/src/qmgr/qmgr_message.c
postfix/src/smtpd/smtpd_check.c

index 6d08693ca8e51b4d5115d172e9f6dfbf8ad3ad53..4867bfdc46233018daba4f751d3de833a71d6cb1 100644 (file)
@@ -14330,3 +14330,16 @@ Apologies for any names omitted.
        {rcpt_addr} information. Problem reported by Anton Yuzhaninov.
        File: smtpd/smtpd.c.
 
+20040811
+
+       Bugfix (introduced Postfix 2.0): after "warn_if_reject
+       reject_unlisted_recipient/sender", the SMTP server mistakenly
+       remembered that recipient/sender validation was already
+       done. File: smtpd/smtpd_check.c.
+
+       Bugfix (introduced Postfix 2.3): the queue manager would
+       initialize missing client logging attributes (from xforward)
+       with real client attributes. Fix: enable this backwards
+       compatibility feature only with queue files that don't
+       contain logging attributes. Problem reported by Liviu Daia.
+       Files *qmgr/qmgr_message.c.
index c9dfe56bf6ca6a427c266527f3382c12c6f457f3..0174a46dde4426de62ebebd71c6d28dc9942ec43 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      "20080317"
-#define MAIL_VERSION_NUMBER    "2.5.2-RC1"
+#define MAIL_RELEASE_DATE      "20080411"
+#define MAIL_VERSION_NUMBER    "2.5.2-RC2"
 
 #ifdef SNAPSHOT
 # define MAIL_VERSION_DATE     "-" MAIL_RELEASE_DATE
index a68cc9ea011e74b2486e0c4faaa015d99e419f13..4334d86841873f5a6e458970b2c4fb850120f35a 100644 (file)
@@ -311,6 +311,7 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
     int     dsn_notify = 0;
     char   *dsn_orcpt = 0;
     int     n;
+    int     have_log_client_attr = 0;
 
     /*
      * Initialize. No early returns or we have a memory leak.
@@ -612,18 +613,24 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
             * client information. To support old queue files, we accept both
             * names for the purpose of logging; the new name overrides the
             * old one.
+            * 
+            * XXX Do not use the "legacy" client_name etc. attribute values for
+            * initializing the logging attributes, when this file already
+            * contains the "modern" log_client_name etc. logging attributes.
+            * Otherwise, logging attributes that are not present in the
+            * queue file would be set with information from the real client.
             */
            else if (strcmp(name, MAIL_ATTR_ACT_CLIENT_NAME) == 0) {
-               if (message->client_name == 0)
+               if (have_log_client_attr == 0 && message->client_name == 0)
                    message->client_name = mystrdup(value);
            } else if (strcmp(name, MAIL_ATTR_ACT_CLIENT_ADDR) == 0) {
-               if (message->client_addr == 0)
+               if (have_log_client_attr == 0 && message->client_addr == 0)
                    message->client_addr = mystrdup(value);
            } else if (strcmp(name, MAIL_ATTR_ACT_PROTO_NAME) == 0) {
-               if (message->client_proto == 0)
+               if (have_log_client_attr == 0 && message->client_proto == 0)
                    message->client_proto = mystrdup(value);
            } else if (strcmp(name, MAIL_ATTR_ACT_HELO_NAME) == 0) {
-               if (message->client_helo == 0)
+               if (have_log_client_attr == 0 && message->client_helo == 0)
                    message->client_helo = mystrdup(value);
            }
            /* Original client attributes. */
@@ -631,22 +638,27 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
                if (message->client_name != 0)
                    myfree(message->client_name);
                message->client_name = mystrdup(value);
+               have_log_client_attr = 1;
            } else if (strcmp(name, MAIL_ATTR_LOG_CLIENT_ADDR) == 0) {
                if (message->client_addr != 0)
                    myfree(message->client_addr);
                message->client_addr = mystrdup(value);
+               have_log_client_attr = 1;
            } else if (strcmp(name, MAIL_ATTR_LOG_CLIENT_PORT) == 0) {
                if (message->client_port != 0)
                    myfree(message->client_port);
                message->client_port = mystrdup(value);
+               have_log_client_attr = 1;
            } else if (strcmp(name, MAIL_ATTR_LOG_PROTO_NAME) == 0) {
                if (message->client_proto != 0)
                    myfree(message->client_proto);
                message->client_proto = mystrdup(value);
+               have_log_client_attr = 1;
            } else if (strcmp(name, MAIL_ATTR_LOG_HELO_NAME) == 0) {
                if (message->client_helo != 0)
                    myfree(message->client_helo);
                message->client_helo = mystrdup(value);
+               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 f2ad51e7b2dc76cdb94181c87d8ee43688c0bd8e..f683fe0aac611713f0d31433bba07650ac48b995 100644 (file)
@@ -334,6 +334,7 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
     int     dsn_notify = 0;
     char   *dsn_orcpt = 0;
     int     n;
+    int     have_log_client_attr = 0;
 
     /*
      * Initialize. No early returns or we have a memory leak.
@@ -653,18 +654,24 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
             * client information. To support old queue files we accept both
             * names for the purpose of logging; the new name overrides the
             * old one.
+            * 
+            * XXX Do not use the "legacy" client_name etc. attribute values for
+            * initializing the logging attributes, when this file already
+            * contains the "modern" log_client_name etc. logging attributes.
+            * Otherwise, logging attributes that are not present in the
+            * queue file would be set with information from the real client.
             */
            else if (strcmp(name, MAIL_ATTR_ACT_CLIENT_NAME) == 0) {
-               if (message->client_name == 0)
+               if (have_log_client_attr == 0 && message->client_name == 0)
                    message->client_name = mystrdup(value);
            } else if (strcmp(name, MAIL_ATTR_ACT_CLIENT_ADDR) == 0) {
-               if (message->client_addr == 0)
+               if (have_log_client_attr == 0 && message->client_addr == 0)
                    message->client_addr = mystrdup(value);
            } else if (strcmp(name, MAIL_ATTR_ACT_PROTO_NAME) == 0) {
-               if (message->client_proto == 0)
+               if (have_log_client_attr == 0 && message->client_proto == 0)
                    message->client_proto = mystrdup(value);
            } else if (strcmp(name, MAIL_ATTR_ACT_HELO_NAME) == 0) {
-               if (message->client_helo == 0)
+               if (have_log_client_attr == 0 && message->client_helo == 0)
                    message->client_helo = mystrdup(value);
            }
            /* Original client attributes. */
@@ -672,22 +679,27 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
                if (message->client_name != 0)
                    myfree(message->client_name);
                message->client_name = mystrdup(value);
+               have_log_client_attr = 1;
            } else if (strcmp(name, MAIL_ATTR_LOG_CLIENT_ADDR) == 0) {
                if (message->client_addr != 0)
                    myfree(message->client_addr);
                message->client_addr = mystrdup(value);
+               have_log_client_attr = 1;
            } else if (strcmp(name, MAIL_ATTR_LOG_CLIENT_PORT) == 0) {
                if (message->client_port != 0)
                    myfree(message->client_port);
                message->client_port = mystrdup(value);
+               have_log_client_attr = 1;
            } else if (strcmp(name, MAIL_ATTR_LOG_PROTO_NAME) == 0) {
                if (message->client_proto != 0)
                    myfree(message->client_proto);
                message->client_proto = mystrdup(value);
+               have_log_client_attr = 1;
            } else if (strcmp(name, MAIL_ATTR_LOG_HELO_NAME) == 0) {
                if (message->client_helo != 0)
                    myfree(message->client_helo);
                message->client_helo = mystrdup(value);
+               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 f1c0366da96d7d4d0ea50d094a6ea419c39c36a0..6cfb704704022ac0e4d90ba5ba8b6727c07248ed 100644 (file)
@@ -4295,7 +4295,9 @@ static int check_recipient_rcpt_maps(SMTPD_STATE *state, const char *recipient)
        return (0);
     if (state->recipient_rcptmap_checked == 1)
        return (0);
-    state->recipient_rcptmap_checked = 1;
+    if (state->warn_if_reject == 0)
+       /* We really validate the recipient address. */
+       state->recipient_rcptmap_checked = 1;
     return (check_rcpt_maps(state, recipient, SMTPD_NAME_RECIPIENT));
 }
 
@@ -4312,7 +4314,9 @@ static int check_sender_rcpt_maps(SMTPD_STATE *state, const char *sender)
        return (0);
     if (state->sender_rcptmap_checked == 1)
        return (0);
-    state->sender_rcptmap_checked = 1;
+    if (state->warn_if_reject == 0)
+       /* We really validate the sender address. */
+       state->sender_rcptmap_checked = 1;
     return (check_rcpt_maps(state, sender, SMTPD_NAME_SENDER));
 }