]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
snapshot-20011116
authorWietse Venema <wietse@porcupine.org>
Fri, 16 Nov 2001 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:27:34 +0000 (06:27 +0000)
postfix/HISTORY
postfix/src/global/mail_version.h
postfix/src/smtpd/smtpd.c
postfix/src/smtpd/smtpd_chat.c

index fb9b2fa00bd5ec3621e6c6ff049604bb4bb2747f..f91617d107a09315c82d2f39a44a31438b9eeacc 100644 (file)
@@ -5586,6 +5586,12 @@ Apologies for any names omitted.
        Bugfix: reset the smtpd command transaction log between
        non-deliveries. File: smtpd/smtpd.c.
 
+20011116
+
+       Bugfix: consolidated all the command transaction log 
+       resets and eliminated one other case (Victor Duchovny,
+       Morgan Stanley). File: smtpd/smtpd.c.
+
 Open problems:
 
        Medium: need in-process caching for map lookups. LDAP
index ada8bd0cceff132ea6da4ac3bd6519e4aa445bd2..e42dbe5170a9887703a5fa711793981c385f0c8f 100644 (file)
@@ -15,7 +15,7 @@
   * Version of this program.
   */
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "Snapshot-20011115"
+#define DEF_MAIL_VERSION       "Snapshot-20011116"
 extern char *var_mail_version;
 
 /* LICENSE
index 85d1dbd45488319580a9a491f2a37b85cccc2385..e2003ffd25d530018d5136c8449ba5618e943bb4 100644 (file)
@@ -385,6 +385,7 @@ char   *smtpd_path;
 static void helo_reset(SMTPD_STATE *);
 static void mail_reset(SMTPD_STATE *);
 static void rcpt_reset(SMTPD_STATE *);
+static void chat_reset(SMTPD_STATE *);
 
 /* collapse_args - put arguments together again */
 
@@ -445,6 +446,7 @@ static int ehlo_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
     if (state->helo_name != 0)
        helo_reset(state);
 #ifndef RFC821_SYNTAX
+    chat_reset(state);
     mail_reset(state);
     rcpt_reset(state);
 #endif
@@ -1059,22 +1061,10 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
      */
     state->where = SMTPD_AFTER_DOT;
 
-    /*
-     * Notify the postmaster if there were errors. This usually indicates a
-     * client configuration problem, or that someone is trying nasty things.
-     * Either is significant enough to bother the postmaster. XXX Can't
-     * report problems when running in stand-alone mode: postmaster notices
-     * require availability of the cleanup service.
-     */
-    if (state->history != 0 && state->client != VSTREAM_IN
-       && (state->error_mask & state->notify_mask))
-       smtpd_chat_notify(state);
-    state->error_mask = 0;
-    smtpd_chat_reset(state);
-
     /*
      * Cleanup. The client may send another MAIL command.
      */
+    chat_reset(state);
     mail_reset(state);
     rcpt_reset(state);
     if (why)
@@ -1096,22 +1086,10 @@ static int rset_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
        return (-1);
     }
 
-    /*
-     * Notify the postmaster if there were errors. This usually indicates a
-     * client configuration problem, or that someone is trying nasty things.
-     * Either is significant enough to bother the postmaster. XXX Can't
-     * report problems when running in stand-alone mode: postmaster notices
-     * require availability of the cleanup service.
-     */
-    if (state->history != 0 && state->client != VSTREAM_IN
-       && (state->error_mask & state->notify_mask))
-       smtpd_chat_notify(state);
-    state->error_mask = 0;
-    smtpd_chat_reset(state);
-
     /*
      * Restore state to right after HELO/EHLO command.
      */
+    chat_reset(state);
     mail_reset(state);
     rcpt_reset(state);
     smtpd_chat_reply(state, "250 Ok");
@@ -1291,6 +1269,24 @@ static int quit_cmd(SMTPD_STATE *state, int unused_argc, SMTPD_TOKEN *unused_arg
     return (0);
 }
 
+/* chat_reset - notify postmaster and reset conversation log */
+
+static void chat_reset(SMTPD_STATE *state)
+{
+
+    /*
+     * Notify the postmaster if there were errors. This usually indicates a
+     * client configuration problem, or that someone is trying nasty things.
+     * Either is significant enough to bother the postmaster. XXX Can't
+     * report problems when running in stand-alone mode: postmaster notices
+     * require availability of the cleanup service.
+     */
+    if (state->history != 0 && state->client != VSTREAM_IN
+       && (state->error_mask & state->notify_mask))
+       smtpd_chat_notify(state);
+    smtpd_chat_reset(state);
+}
+
  /*
   * The table of all SMTP commands that we know. Set the junk limit flag on
   * any command that can be repeated an arbitrary number of times without
@@ -1421,18 +1417,6 @@ static void smtpd_proto(SMTPD_STATE *state)
        msg_info("%s after %s from %s[%s]",
                 state->reason, state->where, state->name, state->addr);
 
-    /*
-     * Notify the postmaster if there were errors but no message was
-     * collected. This usually indicates a client configuration problem, or
-     * that someone is trying nasty things. Either is significant enough to
-     * bother the postmaster. XXX Can't report problems when running in
-     * stand-alone mode: postmaster notices require availability of the
-     * cleanup service.
-     */
-    if (state->history != 0 && state->client != VSTREAM_IN
-       && (state->error_mask & state->notify_mask))
-       smtpd_chat_notify(state);
-
     /*
      * Cleanup whatever information the client gave us during the SMTP
      * dialog.
@@ -1442,9 +1426,9 @@ static void smtpd_proto(SMTPD_STATE *state)
     if (var_smtpd_sasl_enable)
        smtpd_sasl_auth_reset(state);
 #endif
+    chat_reset(state);
     mail_reset(state);
     rcpt_reset(state);
-    smtpd_chat_reset(state);
 }
 
 /* smtpd_service - service one client */
index 13dd756a30ed0a5164b562a46b968868c53ade76..0c875fadacacef6f88f1a6ba20d2024617cb93b4 100644 (file)
@@ -227,7 +227,5 @@ void    smtpd_chat_notify(SMTPD_STATE *state)
     post_mail_fputs(notice, "");
     if (state->reason)
        post_mail_fprintf(notice, "Session aborted, reason: %s", state->reason);
-    else
-       post_mail_fputs(notice, "No message was collected successfully.");
     (void) post_mail_fclose(notice);
 }