From bca5f7d0471ac561d9195101b4ca7f936557a3e8 Mon Sep 17 00:00:00 2001 From: Wietse Venema Date: Fri, 22 Apr 2005 00:00:00 -0500 Subject: [PATCH] postfix-2.3-20050422 --- postfix/HISTORY | 25 ++++++++++++++++++++----- postfix/src/global/mail_version.h | 2 +- postfix/src/lmtp/lmtp_sasl_glue.c | 2 +- postfix/src/postsuper/postsuper.c | 28 ++++++++++++++++++++-------- postfix/src/smtp/smtp_connect.c | 14 +++++++++++--- 5 files changed, 53 insertions(+), 18 deletions(-) diff --git a/postfix/HISTORY b/postfix/HISTORY index 495e6ff48..53dffb506 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -10601,10 +10601,10 @@ Apologies for any names omitted. the MIME processor. Files: global/mime_state.c, cleanup/cleanup_message.c, smtp/smtp_proto.c. - Cleanup: updated error messages about MIME processing - errors in the SMTP client. These errors are no longer - specific to 8bit->7bit conversion; they can also happen - with generic address mapping. File: smtp/smtp_proto.c. + Cleanup: updated error messages about MIME processing errors + in the SMTP client. These errors are no longer specific to + 8bit->7bit conversion; they can also happen with generic + address mapping. File: smtp/smtp_proto.c. Safety: SASL 2.1.19 has a version lookup routine that we can use to detect compile time / run time version mis-matches @@ -10653,7 +10653,7 @@ Apologies for any names omitted. eliminated a portability problem that was introduced when "REJECT text" support was added. File: cleanup/cleanup.c. -20040513 +20050413 Portability: don't mix socket message send/receive calls with socket stream read/write calls. The fact that you can @@ -10673,6 +10673,21 @@ Apologies for any names omitted. Safety: don't call syslog from a user-triggered signal handler. File: postdrop/postdrop.c. +20050421 + + Bugfix: don't panic when the fall-back relay can't be used + because the local MTA is MX for the destination. File: + smtp/smtp_connect.c. + +20050422 + + Bugfix: don't panic when the fall-back relay can't be used + because it was already tried via a cached session. Produce + a default excuse instead. File: smtp/smtp_connect.c. + + Bugfix: postsuper could lose an error message after reporting + a fatal error. File: postsuper/postsuper.c. + Open problems: Med: disable header address rewriting after XCLIENT? diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 46cebddeb..0914990ea 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change the patchlevel and the release date. Snapshots change the * release date only. */ -#define MAIL_RELEASE_DATE "20050418" +#define MAIL_RELEASE_DATE "20050422" #define MAIL_VERSION_NUMBER "2.3" #define VAR_MAIL_VERSION "mail_version" diff --git a/postfix/src/lmtp/lmtp_sasl_glue.c b/postfix/src/lmtp/lmtp_sasl_glue.c index ed5d8692d..3181355a3 100644 --- a/postfix/src/lmtp/lmtp_sasl_glue.c +++ b/postfix/src/lmtp/lmtp_sasl_glue.c @@ -402,7 +402,7 @@ void lmtp_sasl_start(LMTP_STATE *state, const char *sasl_opts_name, */ memset(&sec_props, 0L, sizeof(sec_props)); sec_props.min_ssf = 0; - sec_props.max_ssf = 1; /* don't allow real SASL + sec_props.max_ssf = 0; /* don't allow real SASL * security layer */ sec_props.security_flags = name_mask(sasl_opts_name, lmtp_sasl_sec_mask, sasl_opts_val); diff --git a/postfix/src/postsuper/postsuper.c b/postfix/src/postsuper/postsuper.c index 633e0a42a..32b818d3b 100644 --- a/postfix/src/postsuper/postsuper.c +++ b/postfix/src/postsuper/postsuper.c @@ -943,19 +943,31 @@ static void super(const char **queues, int action) argv_free(hash_queue_names); } -/* fatal_exit - print warning if queue fix is incomplete */ +/* interrupted - signal handler */ -static void fatal_exit(void) +static void interrupted(int sig) { - if (inode_mismatch > 0 || inode_fixed > 0 || position_mismatch > 0) - msg_fatal("OPERATION INCOMPLETE -- RERUN COMMAND TO FIX THE QUEUE FIRST"); + + /* + * This commands requires root privileges. We therefore do not worry + * about hostile signals, and report problems via msg_warn(). + */ + if (signal(SIGHUP, SIG_IGN) != SIG_IGN) { + (void) signal(SIGINT, SIG_IGN); + (void) signal(SIGQUIT, SIG_IGN); + (void) signal(SIGTERM, SIG_IGN); + if (inode_mismatch > 0 || inode_fixed > 0 || position_mismatch > 0) + msg_warn("OPERATION INCOMPLETE -- RERUN COMMAND TO FIX THE QUEUE FIRST"); + if (sig) + _exit(sig); + } } -/* interrupted - signal handler */ +/* fatal_warning - print warning if queue fix is incomplete */ -static void interrupted(int unused_sig) +static void fatal_warning(void) { - fatal_exit(); + interrupted(0); } int main(int argc, char **argv) @@ -1136,7 +1148,7 @@ int main(int argc, char **argv) signal(SIGINT, interrupted); signal(SIGQUIT, interrupted); signal(SIGTERM, interrupted); - msg_cleanup(fatal_exit); + msg_cleanup(fatal_warning); /* * Sanity checks. diff --git a/postfix/src/smtp/smtp_connect.c b/postfix/src/smtp/smtp_connect.c index db25f3fc8..74b8d51a8 100644 --- a/postfix/src/smtp/smtp_connect.c +++ b/postfix/src/smtp/smtp_connect.c @@ -568,8 +568,6 @@ int smtp_connect(SMTP_STATE *state) (*(cpp) && (cpp) >= (sites)->argv + (non_fallback_sites)) for (cpp = sites->argv; SMTP_RCPT_LEFT(state) > 0 && (dest = *cpp) != 0; cpp++) { - if (i_am_mx && IS_FALLBACK_RELAY(cpp, sites, non_fallback_sites)) - break; state->final_server = (cpp[1] == 0); /* @@ -685,7 +683,8 @@ int smtp_connect(SMTP_STATE *state) if ((state->session = session) != 0) { if (++sess_count == var_smtp_mxsess_limit) next = 0; - state->final_server = (cpp[1] == 0 && next == 0); + state->final_server = (next == 0 && (cpp[1] == 0 || (i_am_mx + && IS_FALLBACK_RELAY(cpp + 1, sites, non_fallback_sites)))); if (addr->pref == domain_best_pref) session->features |= SMTP_FEATURE_BEST_MX; if ((session->features & SMTP_FEATURE_FROM_CACHE) != 0 @@ -706,8 +705,17 @@ int smtp_connect(SMTP_STATE *state) * * Pay attention to what could be configuration problems, and pretend that * these are recoverable rather than bouncing the mail. + * + * In case of a "no error" indication we make up an excuse; this can happen + * when the fall-back relay was already tried via a cached connection, so + * that the address list scrubber left behind an empty list. */ if (SMTP_RCPT_LEFT(state) > 0) { + if (smtp_errno == SMTP_ERR_NONE) { + dsn_vstring_update(why, "4.3.0", + "server unavailable or unable to receive mail"); + smtp_errno = SMTP_ERR_RETRY; + } switch (smtp_errno) { default: -- 2.47.3