From 9c4e8f608a0cb5dc688e3c8ac3bc13ef3cb42620 Mon Sep 17 00:00:00 2001 From: Philip Hazel Date: Thu, 7 Apr 2005 10:54:54 +0000 Subject: [PATCH] Change PH/12 for 4.50 fixed one bug and introduced another; if a host's IP address could not be found in an SMTP router, Exim went into a hard loop (unless it was the only host). --- doc/doc-txt/ChangeLog | 8 +++++++- src/src/globals.c | 6 +----- src/src/macros.h | 18 +++++++++--------- src/src/transports/smtp.c | 14 +++++++++----- 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 8befccba9..cb661b943 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.121 2005/04/07 10:10:01 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.122 2005/04/07 10:54:54 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -206,6 +206,12 @@ PH/34 Change 4.50/80 broke Exim in that it could no longer handle cases where the uid or gid is negative. A case of a negative gid caused this to be noticed. The fix allows for either to be negative. +PH/35 ACL_WHERE_MIME is now declared unconditionally, to avoid too much code + clutter, but the tables that are indexed by ACL_WHERE_xxx values had been + overlooked. + +PH/36 The change PH/12 above was broken. Fixed it. + A note about Exim versions 4.44 and 4.50 ---------------------------------------- diff --git a/src/src/globals.c b/src/src/globals.c index 5fe414b43..5a7838be3 100644 --- a/src/src/globals.c +++ b/src/src/globals.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/globals.c,v 1.21 2005/04/04 10:33:49 ph10 Exp $ */ +/* $Cambridge: exim/src/src/globals.c,v 1.22 2005/04/07 10:54:54 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -191,9 +191,7 @@ error codes - keep in step with definitions of ACL_WHERE_xxxx in macros.h. */ uschar *acl_wherenames[] = { US"RCPT", US"MAIL", US"PREDATA", -#ifdef WITH_CONTENT_SCAN US"MIME", -#endif US"DATA", US"non-SMTP", US"AUTH", @@ -210,9 +208,7 @@ uschar *acl_wherenames[] = { US"RCPT", int acl_wherecodes[] = { 550, /* RCPT */ 550, /* MAIL */ 550, /* PREDATA */ -#ifdef WITH_CONTENT_SCAN 550, /* MIME */ -#endif 550, /* DATA */ 0, /* not SMTP; not relevant */ 503, /* AUTH */ diff --git a/src/src/macros.h b/src/src/macros.h index 86bb84f12..2eef204a3 100644 --- a/src/src/macros.h +++ b/src/src/macros.h @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/macros.h,v 1.11 2005/03/22 14:11:54 ph10 Exp $ */ +/* $Cambridge: exim/src/src/macros.h,v 1.12 2005/04/07 10:54:54 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -742,18 +742,18 @@ enum { MCL_STRING, MCL_DOMAIN, MCL_HOST, MCL_ADDRESS, MCL_LOCALPART }; /* Codes for the places from which ACLs can be called. These are cunningly ordered to make it easy to implement tests for certain ACLs when processing "control" modifiers, by means of a maximum "where" value. Do not modify this -order without checking carefully! Furthermore, remember to keep these in step -with the tables of names and response codes in globals.c. */ +order without checking carefully! + +**** IMPORTANT*** +**** Furthermore, remember to keep these in step with the tables +**** of names and response codes in globals.c. +**** IMPORTANT **** +*/ enum { ACL_WHERE_RCPT, /* Some controls are for RCPT only */ ACL_WHERE_MAIL, /* ) */ ACL_WHERE_PREDATA, /* ) There are several tests for "in message", */ - /* ) implemented by <= WHERE_NOTSMTP */ - -/* Remove next line in case of removeing WITH_CONTENT_SCAN. - ACL_WHERE_MIME is defined unconditionally to avoid clutter in acl.c */ - ACL_WHERE_MIME, /* ) */ - + ACL_WHERE_MIME, /* ) implemented by <= WHERE_NOTSMTP */ ACL_WHERE_DATA, /* ) */ ACL_WHERE_NOTSMTP, /* ) */ diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c index 91410332d..f53d742e4 100644 --- a/src/src/transports/smtp.c +++ b/src/src/transports/smtp.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/transports/smtp.c,v 1.9 2005/04/06 15:26:52 ph10 Exp $ */ +/* $Cambridge: exim/src/src/transports/smtp.c,v 1.10 2005/04/07 10:54:54 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -2175,6 +2175,12 @@ for (cutoff_retry = 0; expired && uschar *retry_message_key = NULL; uschar *serialize_key = NULL; + /* Default next host is next host. :-) But this can vary if the + hosts_max_try limit is hit (see below). It may also be reset if a host + address is looked up here (in case the host was multihomed). */ + + nexthost = host->next; + /* Set the flag requesting that this host be added to the waiting database if the delivery fails temporarily or if we are running with queue_smtp or a 2-stage queue run. This gets unset for certain @@ -2281,10 +2287,8 @@ for (cutoff_retry = 0; expired && continue; /* With next host */ } - /* The default next host is the next host. :-) But this can vary if the - hosts_max_try limit is hit (see below). NOTE: we cannot put this setting - earlier than this, because a multihomed host whose addresses are not looked - up till just above will add to the host list. */ + /* Reset the default next host in case a multihomed host whose addresses + are not looked up till just above added to the host list. */ nexthost = host->next; -- 2.25.1