From: Wietse Venema Date: Fri, 16 Nov 2001 05:00:00 +0000 (-0500) Subject: snapshot-20011116 X-Git-Tag: v1.1.0~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28d80b93ca0eda6c7dc64bcc570c8881a18e6873;p=thirdparty%2Fpostfix.git snapshot-20011116 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index fb9b2fa00..f91617d10 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -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 diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index ada8bd0cc..e42dbe517 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -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 diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c index 85d1dbd45..e2003ffd2 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -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 */ diff --git a/postfix/src/smtpd/smtpd_chat.c b/postfix/src/smtpd/smtpd_chat.c index 13dd756a3..0c875fada 100644 --- a/postfix/src/smtpd/smtpd_chat.c +++ b/postfix/src/smtpd/smtpd_chat.c @@ -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); }