2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-08-30 05:38:06 +00:00

postfix-3.4-20181119

This commit is contained in:
Wietse Venema 2018-11-19 00:00:00 -05:00 committed by Viktor Dukhovni
parent 2cda534f4b
commit 48634afcef
8 changed files with 54 additions and 51 deletions

View File

@ -23815,3 +23815,8 @@ Apologies for any names omitted.
current reality. Files: smtp_reuse.c, smtp_key.c, smtp_proto.c, current reality. Files: smtp_reuse.c, smtp_key.c, smtp_proto.c,
smtp_tls_policy.c, smtp.h, smtp_connect.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.

View File

@ -1,5 +1,8 @@
Wish list: 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 With DICT_FLAG_RHS_IS_FILE, should dict_update() open a
file? base64-encode the value? file? base64-encode the value?
@ -16,11 +19,6 @@ Wish list:
the parameter value, which is probably why the warning the parameter value, which is probably why the warning
exists. 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: Things to do before the stable release:
Spell-check, double-word check, HTML validator check, Spell-check, double-word check, HTML validator check,

View File

@ -60,8 +60,8 @@
# are known to support it. # are known to support it.
# .IP \fB-DNO_EAI\fR # .IP \fB-DNO_EAI\fR
# Do not build with EAI (SMTPUTF8) support. By default, EAI # Do not build with EAI (SMTPUTF8) support. By default, EAI
# support is compiled in when the "icu-config" command is # support is compiled in when the "pkg-config" command is
# found. # found, or the deprecated "icu-config" command.
# .IP \fB-DNO_INLINE\fR # .IP \fB-DNO_INLINE\fR
# Do not require support for C99 "inline" functions. Instead, # Do not require support for C99 "inline" functions. Instead,
# implement argument typechecks for non-(printf/scanf)-like # implement argument typechecks for non-(printf/scanf)-like
@ -792,8 +792,10 @@ esac
# #
case "$CCARGS" in case "$CCARGS" in
*-DNO_EAI*) CCARGS="$CCARGS "'-DDEF_SMTPUTF8_ENABLE=\"no\"';; *-DNO_EAI*) CCARGS="$CCARGS "'-DDEF_SMTPUTF8_ENABLE=\"no\"';;
*) icu_cppflags=`(icu-config --cppflags) 2>/dev/null` && { *) icu_cppflags=`((pkg-config --cflags icu-uc icu-i18n) ||
icu_ldflags=`(icu-config --ldflags) 2>/dev/null` && { (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 trap 'rm -f makedefs.test makedefs.test.[co]' 1 2 3 15
cat >makedefs.test.c <<'EOF' cat >makedefs.test.c <<'EOF'
#include <unicode/uidna.h> #include <unicode/uidna.h>

View File

@ -20,7 +20,7 @@
* Patches change both the patchlevel and the release date. Snapshots have no * Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only. * patchlevel; they change the release date only.
*/ */
#define MAIL_RELEASE_DATE "20181118" #define MAIL_RELEASE_DATE "20181119"
#define MAIL_VERSION_NUMBER "3.4" #define MAIL_VERSION_NUMBER "3.4"
#ifdef SNAPSHOT #ifdef SNAPSHOT

View File

@ -54,7 +54,7 @@
*/ */
typedef struct SMTP_ITERATOR { typedef struct SMTP_ITERATOR {
/* Public members. */ /* Public members. */
VSTRING *request_nexthop; /* request nexhop or empty */ VSTRING *request_nexthop; /* delivery request nexhop or empty */
VSTRING *dest; /* current nexthop */ VSTRING *dest; /* current nexthop */
VSTRING *host; /* hostname or empty */ VSTRING *host; /* hostname or empty */
VSTRING *addr; /* printable address or empty */ VSTRING *addr; /* printable address or empty */
@ -76,12 +76,6 @@ typedef struct SMTP_ITERATOR {
(iter)->parent = (state); \ (iter)->parent = (state); \
} while (0) } 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 { \ #define SMTP_ITER_SAVE_DEST(iter) do { \
vstring_strcpy((iter)->saved_dest, STR((iter)->dest)); \ vstring_strcpy((iter)->saved_dest, STR((iter)->dest)); \
} while (0) } while (0)
@ -195,11 +189,12 @@ typedef struct SMTP_STATE {
* Primitives to enable/disable/test connection caching and reuse based on * Primitives to enable/disable/test connection caching and reuse based on
* the delivery request next-hop destination (i.e. not smtp_fallback_relay). * the delivery request next-hop destination (i.e. not smtp_fallback_relay).
* *
* Connection cache lookup by the request next-hop destination allows a reuse * Connection cache lookup by the delivery request next-hop destination allows
* request to skip over bad hosts, and may result in a connection to a * a reuse request to skip over bad hosts, and may result in a connection to
* fall-back relay. Once we have found a 'good' host for a request next-hop, * a fall-back relay. Once we have found a 'good' host for a delivery
* clear the request next-hop destination, to avoid caching less-preferred * request next-hop, clear the delivery request next-hop destination, to
* connections under that same request next-hop. * avoid caching less-preferred connections under that same delivery request
* next-hop.
*/ */
#define SET_SCACHE_REQUEST_NEXTHOP(state, nexthop) do { \ #define SET_SCACHE_REQUEST_NEXTHOP(state, nexthop) do { \
vstring_strcpy((state)->iterator->request_nexthop, nexthop); \ 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_SERVICE (1<<0) /* service name */
#define SMTP_KEY_FLAG_SENDER (1<<1) /* sender address */ #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_CUR_NEXTHOP (1<<3) /* current nexthop */
#define SMTP_KEY_FLAG_HOSTNAME (1<<4) /* remote host name */ #define SMTP_KEY_FLAG_HOSTNAME (1<<4) /* remote host name */
#define SMTP_KEY_FLAG_ADDR (1<<5) /* remote address */ #define SMTP_KEY_FLAG_ADDR (1<<5) /* remote address */

View File

@ -417,10 +417,10 @@ static void smtp_cleanup_session(SMTP_STATE *state)
state->session = 0; 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 * that we won't cache connections to less-preferred servers under the
* logical next-hop destination. Otherwise we could end up skipping over * same next-hop destination. Otherwise we could end up skipping over the
* the available and more-preferred servers. * available and more-preferred servers.
*/ */
if (HAVE_SCACHE_REQUEST_NEXTHOP(state) && !throttled) if (HAVE_SCACHE_REQUEST_NEXTHOP(state) && !throttled)
CLEAR_SCACHE_REQUEST_NEXTHOP(state); 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; DSN_BUF *why = state->why;
/* /*
* First, search the cache by request nexthop. We truncate the server * First, search the cache by delivery request nexthop. We truncate the
* address list when all the sessions for this destination are used up, * server address list when all the sessions for this destination are
* to reduce the number of variables that need to be checked later. * 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 * smtp_reuse_nexthop() clobbers the iterators's "dest" attribute. We save
* and restore it here, so that subsequent connections will use the * 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; domain_best_pref = addr_list->pref;
/* /*
* When session caching is enabled, store the first good session for * When connection caching is enabled, store the first good
* this delivery request under the next-hop destination name. All * connection for this delivery request under the delivery request
* good sessions will be stored under their specific server IP * next-hop name. Good connections will also be stored under their
* address. * specific server IP address.
* *
* XXX smtp_session_cache_destinations specifies domain names without * XXX smtp_session_cache_destinations specifies domain names without
* :port, because : is already used for maptype:mapname. Because of * :port, because : is already used for maptype:mapname. Because of

View File

@ -51,13 +51,13 @@
/* The envelope sender address. This is a proxy for sender-dependent /* The envelope sender address. This is a proxy for sender-dependent
/* context, such as per-sender SASL authentication. /* context, such as per-sender SASL authentication.
/* .IP SMTP_KEY_FLAG_REQ_NEXTHOP /* .IP SMTP_KEY_FLAG_REQ_NEXTHOP
/* The request nexthop destination. This is a proxy for /* The delivery request nexthop destination. This is a proxy
/* destination-dependent, but host-independent context. /* for destination-dependent, but host-independent context.
/* .IP SMTP_KEY_FLAG_CUR_NEXTHOP /* .IP SMTP_KEY_FLAG_CUR_NEXTHOP
/* The current iterator's nexthop destination (request nexthop /* The current iterator's nexthop destination (delivery request
/* or fallback nexthop, including optional [] and :port). This /* nexthop or fallback nexthop, including optional [] and
/* is the form that users specify in a SASL or TLS lookup /* :port). This is the form that users specify in a SASL or
/* tables. /* TLS lookup tables.
/* .IP SMTP_KEY_FLAG_HOSTNAME /* .IP SMTP_KEY_FLAG_HOSTNAME
/* The current iterator's remote hostname. /* The current iterator's remote hostname.
/* .IP SMTP_KEY_FLAG_ADDR /* .IP SMTP_KEY_FLAG_ADDR

View File

@ -36,8 +36,9 @@
/* case of a null stream and will assume it was given a different /* case of a null stream and will assume it was given a different
/* purpose. /* purpose.
/* /*
/* smtp_session_passivate() flattens an SMTP session so that /* smtp_session_passivate() flattens an SMTP session (including
/* it can be cached. The SMTP_SESSION structure is destroyed. /* TLS context) so that it can be cached. The SMTP_SESSION
/* structure is destroyed.
/* /*
/* smtp_session_activate() inflates a flattened SMTP session /* smtp_session_activate() inflates a flattened SMTP session
/* so that it can be used. The input property arguments are /* 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; int fd;
/* /*
* Encode the local-to-physical binding properties: whether or not this * Encode the delivery request next-hop to endpoint binding properties:
* server is best MX host for the next-hop or fall-back logical * whether or not this server is best MX host for the delivery request
* destination (this information is needed for loop handling in * next-hop or fall-back logical destination (this information is needed
* smtp_proto()). * for loop handling in smtp_proto()).
* *
* TODO: save SASL username and password information so that we can * TODO: save SASL username and password information so that we can
* correctly save a reused authenticated connection. * 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 * Encode the physical endpoint properties: all the session properties
* except for "session from cache", "best MX", or "RSET failure". * except for "session from cache", "best MX", or "RSET failure". Plus
* Plus the TLS level, reuse count, and connection expiration time. * the TLS level, reuse count, and connection expiration time.
* *
* XXX Should also record how many non-delivering mail transactions there * XXX Should also record how many non-delivering mail transactions there
* were during this session, and perhaps other statistics, so that we * 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 * Clobber the iterator's current nexthop, host and address fields with
* cached-connection information. This is done when a session is looked * 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 * up by delivery request nexthop instead of address and port. It is the
* responsibility to save and restore the request nexthop with * caller's responsibility to save and restore the delivery request
* SMTP_ITER_SAVE_DEST() and SMTP_ITER_RESTORE_DEST(). * nexthop with SMTP_ITER_SAVE_DEST() and SMTP_ITER_RESTORE_DEST().
* *
* TODO: Eliminate the duplication between SMTP_ITERATOR and SMTP_SESSION. * TODO: Eliminate the duplication between SMTP_ITERATOR and SMTP_SESSION.
* *