From 48634afcef8098e332de343cc6acab93d006f8a7 Mon Sep 17 00:00:00 2001 From: Wietse Venema Date: Mon, 19 Nov 2018 00:00:00 -0500 Subject: [PATCH] postfix-3.4-20181119 --- postfix/HISTORY | 5 +++++ postfix/WISHLIST | 8 +++----- postfix/makedefs | 10 ++++++---- postfix/src/global/mail_version.h | 2 +- postfix/src/smtp/smtp.h | 21 ++++++++------------- postfix/src/smtp/smtp_connect.c | 24 +++++++++++++----------- postfix/src/smtp/smtp_key.c | 12 ++++++------ postfix/src/smtp/smtp_session.c | 23 ++++++++++++----------- 8 files changed, 54 insertions(+), 51 deletions(-) diff --git a/postfix/HISTORY b/postfix/HISTORY index ac502c1a5..488629f98 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -23815,3 +23815,8 @@ Apologies for any names omitted. current reality. Files: smtp_reuse.c, smtp_key.c, smtp_proto.c, smtp_tls_policy.c, smtp.h, smtp_connect.c. +20181119 + + Bitrot: makedefs will use "pkg-config" to locate ICU build + information, falling back to "icu-config" if "pkg-config" + is not found. File: makedefs. diff --git a/postfix/WISHLIST b/postfix/WISHLIST index 6b78d3f2f..dfc4353db 100644 --- a/postfix/WISHLIST +++ b/postfix/WISHLIST @@ -1,5 +1,8 @@ Wish list: + With DICT_FLAG_RHS_IS_FILE, RHS is list of files (insert + newline for robustness). + With DICT_FLAG_RHS_IS_FILE, should dict_update() open a file? base64-encode the value? @@ -16,11 +19,6 @@ Wish list: the parameter value, which is probably why the warning exists. - Optionally save application attributes in scache(8) connection - store requests, and optionally request such attributes upon - connection retrieval. This would allow the SMTP client to - log the TLS properties of a reused session. - Things to do before the stable release: Spell-check, double-word check, HTML validator check, diff --git a/postfix/makedefs b/postfix/makedefs index c3efa42c6..5b16e1fb3 100644 --- a/postfix/makedefs +++ b/postfix/makedefs @@ -60,8 +60,8 @@ # are known to support it. # .IP \fB-DNO_EAI\fR # Do not build with EAI (SMTPUTF8) support. By default, EAI -# support is compiled in when the "icu-config" command is -# found. +# support is compiled in when the "pkg-config" command is +# found, or the deprecated "icu-config" command. # .IP \fB-DNO_INLINE\fR # Do not require support for C99 "inline" functions. Instead, # implement argument typechecks for non-(printf/scanf)-like @@ -792,8 +792,10 @@ esac # case "$CCARGS" in *-DNO_EAI*) CCARGS="$CCARGS "'-DDEF_SMTPUTF8_ENABLE=\"no\"';; - *) icu_cppflags=`(icu-config --cppflags) 2>/dev/null` && { - icu_ldflags=`(icu-config --ldflags) 2>/dev/null` && { + *) icu_cppflags=`((pkg-config --cflags icu-uc icu-i18n) || + (icu-config --cppflags)) 2>/dev/null` && { + icu_ldflags=`((pkg-config --libs icu-uc icu-i18n) || + (icu-config --ldflags)) 2>/dev/null` && { trap 'rm -f makedefs.test makedefs.test.[co]' 1 2 3 15 cat >makedefs.test.c <<'EOF' #include diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index ba90a1ddf..1e927a5a1 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ -#define MAIL_RELEASE_DATE "20181118" +#define MAIL_RELEASE_DATE "20181119" #define MAIL_VERSION_NUMBER "3.4" #ifdef SNAPSHOT diff --git a/postfix/src/smtp/smtp.h b/postfix/src/smtp/smtp.h index effc658a1..051723423 100644 --- a/postfix/src/smtp/smtp.h +++ b/postfix/src/smtp/smtp.h @@ -54,7 +54,7 @@ */ typedef struct SMTP_ITERATOR { /* Public members. */ - VSTRING *request_nexthop; /* request nexhop or empty */ + VSTRING *request_nexthop; /* delivery request nexhop or empty */ VSTRING *dest; /* current nexthop */ VSTRING *host; /* hostname or empty */ VSTRING *addr; /* printable address or empty */ @@ -76,12 +76,6 @@ typedef struct SMTP_ITERATOR { (iter)->parent = (state); \ } while (0) -#define SMTP_ITER_CLOBBER(iter, _dest, _host, _addr) do { \ - vstring_strcpy((iter)->dest, (_dest)); \ - vstring_strcpy((iter)->host, (_host)); \ - vstring_strcpy((iter)->addr, (_addr)); \ - } while (0) - #define SMTP_ITER_SAVE_DEST(iter) do { \ vstring_strcpy((iter)->saved_dest, STR((iter)->dest)); \ } while (0) @@ -195,11 +189,12 @@ typedef struct SMTP_STATE { * Primitives to enable/disable/test connection caching and reuse based on * the delivery request next-hop destination (i.e. not smtp_fallback_relay). * - * Connection cache lookup by the request next-hop destination allows a reuse - * request to skip over bad hosts, and may result in a connection to a - * fall-back relay. Once we have found a 'good' host for a request next-hop, - * clear the request next-hop destination, to avoid caching less-preferred - * connections under that same request next-hop. + * Connection cache lookup by the delivery request next-hop destination allows + * a reuse request to skip over bad hosts, and may result in a connection to + * a fall-back relay. Once we have found a 'good' host for a delivery + * request next-hop, clear the delivery request next-hop destination, to + * avoid caching less-preferred connections under that same delivery request + * next-hop. */ #define SET_SCACHE_REQUEST_NEXTHOP(state, nexthop) do { \ vstring_strcpy((state)->iterator->request_nexthop, nexthop); \ @@ -625,7 +620,7 @@ char *smtp_key_prefix(VSTRING *, const char *, SMTP_ITERATOR *, int); #define SMTP_KEY_FLAG_SERVICE (1<<0) /* service name */ #define SMTP_KEY_FLAG_SENDER (1<<1) /* sender address */ -#define SMTP_KEY_FLAG_REQ_NEXTHOP (1<<2) /* request nexthop */ +#define SMTP_KEY_FLAG_REQ_NEXTHOP (1<<2) /* delivery request nexthop */ #define SMTP_KEY_FLAG_CUR_NEXTHOP (1<<3) /* current nexthop */ #define SMTP_KEY_FLAG_HOSTNAME (1<<4) /* remote host name */ #define SMTP_KEY_FLAG_ADDR (1<<5) /* remote address */ diff --git a/postfix/src/smtp/smtp_connect.c b/postfix/src/smtp/smtp_connect.c index d5693c7c8..dc142ff70 100644 --- a/postfix/src/smtp/smtp_connect.c +++ b/postfix/src/smtp/smtp_connect.c @@ -417,10 +417,10 @@ static void smtp_cleanup_session(SMTP_STATE *state) state->session = 0; /* - * If this session was good, reset the logical next-hop destination, so + * If this session was good, reset the scache next-hop destination, so * that we won't cache connections to less-preferred servers under the - * logical next-hop destination. Otherwise we could end up skipping over - * the available and more-preferred servers. + * same next-hop destination. Otherwise we could end up skipping over the + * available and more-preferred servers. */ if (HAVE_SCACHE_REQUEST_NEXTHOP(state) && !throttled) CLEAR_SCACHE_REQUEST_NEXTHOP(state); @@ -657,11 +657,13 @@ static int smtp_reuse_session(SMTP_STATE *state, DNS_RR **addr_list, DSN_BUF *why = state->why; /* - * First, search the cache by request nexthop. We truncate the server - * address list when all the sessions for this destination are used up, - * to reduce the number of variables that need to be checked later. + * First, search the cache by delivery request nexthop. We truncate the + * server address list when all the sessions for this destination are + * used up, to reduce the number of variables that need to be checked + * later. * - * Note: lookup by logical destination restores the "best MX" bit. + * Note: connection reuse by delivery request nexthop restores the "best MX" + * bit. * * smtp_reuse_nexthop() clobbers the iterators's "dest" attribute. We save * and restore it here, so that subsequent connections will use the @@ -880,10 +882,10 @@ static void smtp_connect_inet(SMTP_STATE *state, const char *nexthop, domain_best_pref = addr_list->pref; /* - * When session caching is enabled, store the first good session for - * this delivery request under the next-hop destination name. All - * good sessions will be stored under their specific server IP - * address. + * When connection caching is enabled, store the first good + * connection for this delivery request under the delivery request + * next-hop name. Good connections will also be stored under their + * specific server IP address. * * XXX smtp_session_cache_destinations specifies domain names without * :port, because : is already used for maptype:mapname. Because of diff --git a/postfix/src/smtp/smtp_key.c b/postfix/src/smtp/smtp_key.c index 8b5db76a2..b11189be4 100644 --- a/postfix/src/smtp/smtp_key.c +++ b/postfix/src/smtp/smtp_key.c @@ -51,13 +51,13 @@ /* The envelope sender address. This is a proxy for sender-dependent /* context, such as per-sender SASL authentication. /* .IP SMTP_KEY_FLAG_REQ_NEXTHOP -/* The request nexthop destination. This is a proxy for -/* destination-dependent, but host-independent context. +/* The delivery request nexthop destination. This is a proxy +/* for destination-dependent, but host-independent context. /* .IP SMTP_KEY_FLAG_CUR_NEXTHOP -/* The current iterator's nexthop destination (request nexthop -/* or fallback nexthop, including optional [] and :port). This -/* is the form that users specify in a SASL or TLS lookup -/* tables. +/* The current iterator's nexthop destination (delivery request +/* nexthop or fallback nexthop, including optional [] and +/* :port). This is the form that users specify in a SASL or +/* TLS lookup tables. /* .IP SMTP_KEY_FLAG_HOSTNAME /* The current iterator's remote hostname. /* .IP SMTP_KEY_FLAG_ADDR diff --git a/postfix/src/smtp/smtp_session.c b/postfix/src/smtp/smtp_session.c index 7ae9afd0c..3b73e8866 100644 --- a/postfix/src/smtp/smtp_session.c +++ b/postfix/src/smtp/smtp_session.c @@ -36,8 +36,9 @@ /* case of a null stream and will assume it was given a different /* purpose. /* -/* smtp_session_passivate() flattens an SMTP session so that -/* it can be cached. The SMTP_SESSION structure is destroyed. +/* smtp_session_passivate() flattens an SMTP session (including +/* TLS context) so that it can be cached. The SMTP_SESSION +/* structure is destroyed. /* /* smtp_session_activate() inflates a flattened SMTP session /* so that it can be used. The input property arguments are @@ -242,10 +243,10 @@ int smtp_session_passivate(SMTP_SESSION *session, VSTRING *dest_prop, int fd; /* - * Encode the local-to-physical binding properties: whether or not this - * server is best MX host for the next-hop or fall-back logical - * destination (this information is needed for loop handling in - * smtp_proto()). + * Encode the delivery request next-hop to endpoint binding properties: + * whether or not this server is best MX host for the delivery request + * next-hop or fall-back logical destination (this information is needed + * for loop handling in smtp_proto()). * * TODO: save SASL username and password information so that we can * correctly save a reused authenticated connection. @@ -265,8 +266,8 @@ int smtp_session_passivate(SMTP_SESSION *session, VSTRING *dest_prop, /* * Encode the physical endpoint properties: all the session properties - * except for "session from cache", "best MX", or "RSET failure". - * Plus the TLS level, reuse count, and connection expiration time. + * except for "session from cache", "best MX", or "RSET failure". Plus + * the TLS level, reuse count, and connection expiration time. * * XXX Should also record how many non-delivering mail transactions there * were during this session, and perhaps other statistics, so that we @@ -372,9 +373,9 @@ SMTP_SESSION *smtp_session_activate(int fd, SMTP_ITERATOR *iter, /* * Clobber the iterator's current nexthop, host and address fields with * cached-connection information. This is done when a session is looked - * up by request nexthop instead of address and port. It is the caller's - * responsibility to save and restore the request nexthop with - * SMTP_ITER_SAVE_DEST() and SMTP_ITER_RESTORE_DEST(). + * up by delivery request nexthop instead of address and port. It is the + * caller's responsibility to save and restore the delivery request + * nexthop with SMTP_ITER_SAVE_DEST() and SMTP_ITER_RESTORE_DEST(). * * TODO: Eliminate the duplication between SMTP_ITERATOR and SMTP_SESSION. *