From 66bc6411d2107788153a78b6618a0d3c970e7f7b Mon Sep 17 00:00:00 2001
From: Wietse Venema
The sender_dependent_relayhost_maps search string that will be +used instead of the null sender address.
+ +This feature is available in Postfix 2.5 and later. With +earlier versions, sender_dependent_relayhost_maps lookups were +skipped for the null sender address.
+ +The sender_dependent_relayhost_maps search string that will be +used instead of the null sender address.
+ +This feature is available in Postfix 2.5 and later. With +earlier versions, sender_dependent_relayhost_maps lookups were +skipped for the null sender address.
+ %PARAM address_verify_sender_dependent_relayhost_maps emptydiff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index 35b4a5558..6579ade12 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -192,6 +192,10 @@ extern char *var_relayhost; #define DEF_SND_RELAY_MAPS "" extern char *var_snd_relay_maps; +#define VAR_NULL_RELAY_MAPS_KEY "empty_address_relayhost_maps_lookup_key" +#define DEF_NULL_RELAY_MAPS_KEY "<>" +extern char *var_null_relay_maps_key; + #define VAR_SMTP_FALLBACK "smtp_fallback_relay" #define DEF_SMTP_FALLBACK "$fallback_relay" #define VAR_LMTP_FALLBACK "smtp_fallback_relay" diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 51f2f6868..62f2fc5e4 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 "20071121" +#define MAIL_RELEASE_DATE "20071122" #define MAIL_VERSION_NUMBER "2.5" #ifdef SNAPSHOT diff --git a/postfix/src/qmgr/qmgr_queue.c b/postfix/src/qmgr/qmgr_queue.c index 4d86aea2f..08a5f1858 100644 --- a/postfix/src/qmgr/qmgr_queue.c +++ b/postfix/src/qmgr/qmgr_queue.c @@ -310,8 +310,11 @@ void qmgr_queue_throttle(QMGR_QUEUE *queue, DSN *dsn) * adjustments on the concurrency limit itself, instead of using the * actual concurrency. The latter fluctuates wildly when deliveries * complete in bursts (artificial benchmark measurements). + * + * Even after reaching 1, we maintain the negative hysteresis cycle so that + * negative feedback can cancel out positive feedback. */ - if (queue->window > 1) { + if (queue->window > 0) { feedback = QMGR_FEEDBACK_VAL(qmgr_neg_feedback_idx, queue->window); QMGR_LOG_FEEDBACK(feedback); queue->failure -= feedback; diff --git a/postfix/src/trivial-rewrite/resolve.c b/postfix/src/trivial-rewrite/resolve.c index c67d186f2..92a3c173d 100644 --- a/postfix/src/trivial-rewrite/resolve.c +++ b/postfix/src/trivial-rewrite/resolve.c @@ -507,8 +507,9 @@ static void resolve_addr(RES_CONTEXT *rp, char *sender, char *addr, * With off-host delivery, sender-dependent or global relayhost * override the recipient domain. */ - if (rp->snd_relay_info && *sender - && (relay = mail_addr_find(rp->snd_relay_info, sender, + if (rp->snd_relay_info + && (relay = mail_addr_find(rp->snd_relay_info, *sender ? + sender : var_null_relay_maps_key, (char **) 0)) != 0) vstring_strcpy(nexthop, relay); else if (*RES_PARAM_VALUE(rp->relayhost)) diff --git a/postfix/src/trivial-rewrite/trivial-rewrite.c b/postfix/src/trivial-rewrite/trivial-rewrite.c index fd315a201..2b7c9eab6 100644 --- a/postfix/src/trivial-rewrite/trivial-rewrite.c +++ b/postfix/src/trivial-rewrite/trivial-rewrite.c @@ -150,6 +150,11 @@ /* .IP "\fBsender_dependent_relayhost_maps (empty)\fR" /* A sender-dependent override for the global relayhost parameter /* setting. +/* .PP +/* Available in Postfix version 2.5 and later: +/* .IP "\fBempty_address_relayhost_maps_lookup_key (<>)\fR" +/* The sender_dependent_relayhost_maps search string that will be +/* used instead of the null sender address. /* ADDRESS VERIFICATION CONTROLS /* .ad /* .fi @@ -315,6 +320,7 @@ int var_show_unk_rcpt_table; int var_resolve_nulldom; char *var_remote_rwr_domain; char *var_snd_relay_maps; +char *var_null_relay_maps_key; int var_resolve_num_dom; /* @@ -557,6 +563,7 @@ int main(int argc, char **argv) VAR_VRFY_RELAYHOST, DEF_VRFY_RELAYHOST, &var_vrfy_relayhost, 0, 0, VAR_REM_RWR_DOMAIN, DEF_REM_RWR_DOMAIN, &var_remote_rwr_domain, 0, 0, VAR_SND_RELAY_MAPS, DEF_SND_RELAY_MAPS, &var_snd_relay_maps, 0, 0, + VAR_NULL_RELAY_MAPS_KEY, DEF_NULL_RELAY_MAPS_KEY, &var_null_relay_maps_key, 1, 0, VAR_VRFY_RELAY_MAPS, DEF_VRFY_RELAY_MAPS, &var_vrfy_relay_maps, 0, 0, 0, }; diff --git a/postfix/src/util/dict.h b/postfix/src/util/dict.h index 63ea133f6..de1691f08 100644 --- a/postfix/src/util/dict.h +++ b/postfix/src/util/dict.h @@ -137,7 +137,7 @@ extern DICT *dict_open(const char *, int, int); extern DICT *dict_open3(const char *, const char *, int, int); extern void dict_open_register(const char *, DICT *(*) (const char *, int, int)); -#define dict_get(dp, key) (dp)->lookup((dp), (key)) +#define dict_get(dp, key) ((const char *) (dp)->lookup((dp), (key))) #define dict_put(dp, key, val) (dp)->update((dp), (key), (val)) #define dict_del(dp, key) (dp)->delete((dp), (key)) #define dict_seq(dp, f, key, val) (dp)->sequence((dp), (f), (key), (val)) diff --git a/postfix/src/util/dict_open.c b/postfix/src/util/dict_open.c index d56507918..233039c08 100644 --- a/postfix/src/util/dict_open.c +++ b/postfix/src/util/dict_open.c @@ -22,7 +22,7 @@ /* const char *key; /* const char *value; /* -/* char *dict_get(dict, key) +/* const char *dict_get(dict, key) /* DICT *dict; /* const char *key; /* @@ -137,6 +137,9 @@ /* /* dict_get() retrieves the value stored in the named dictionary /* under the given key. A null pointer means the value was not found. +/* As with dict_lookup(), the result is owned by the lookup table +/* implementation. Make a copy if the result is to be modified, +/* or if the result is to survive multiple table lookups. /* /* dict_put() stores the specified key and value into the named /* dictionary.