diff --git a/postfix/HISTORY b/postfix/HISTORY index 9cb1b12b5..7a886a0b1 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -13839,3 +13839,14 @@ Apologies for any names omitted. further review the number of parameters will be consolidated and the defaults will select the better algorithms. Files: qmgr/qmgr_queue.c, qmgr/qmgr_deliver.c. + +20071121 + + Boundary condition: Patrik Rak pointed out that handling + of negative feedback with concurrency window 1 could + be improved. + + Feature: support to look up null sender addresses + in sender-dependent relayhost maps. Parameter name: + empty_address_relayhost_maps_lookup_key (default; <>). + Keean Schupke. File: trivial-rewrite/resolve.c. diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index c9dff4ce1..d6d5999ed 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -33,10 +33,9 @@ number of pseudo-cohorts(*) reports connection or handshake failure. The drawbacks of the old +/-1 feedback scheduler are a) overshoot due to exponential delivery concurrency growth with each pseudo-cohort(*) (5-10-20...); b) throttling down to zero concurrency after a single -pseudo-cohort(*) failure. The second problem was especially an issue -with low-concurrency channels where a single failure could be -sufficient to mark a destination as "dead", and suspend further -deliveries. +pseudo-cohort(*) failure. This was especially an issue with +low-concurrency channels where a single failure could be sufficient +to mark a destination as "dead", and suspend further deliveries. The new code is a laboratory model with a multitude of configuration parameters, so that developers can experiment with different feedback diff --git a/postfix/WISHLIST b/postfix/WISHLIST index 30c45f92d..7592b261f 100644 --- a/postfix/WISHLIST +++ b/postfix/WISHLIST @@ -1,5 +1,7 @@ Wish list: + document dict_get() as returning const char * + Make event_drain() a proper event loop; update the zero mask, and don't ignore a non-empty timer queue. diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index 2d9054f51..eb47366d3 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -2253,6 +2253,19 @@ created locally as the result of configuration or software error.

+ + +
empty_address_relayhost_maps_lookup_key +(default: <>)
+ +

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.

+ +
enable_errors_to diff --git a/postfix/html/trivial-rewrite.8.html b/postfix/html/trivial-rewrite.8.html index 18b5b7a34..108485745 100644 --- a/postfix/html/trivial-rewrite.8.html +++ b/postfix/html/trivial-rewrite.8.html @@ -193,6 +193,13 @@ TRIVIAL-REWRITE(8) TRIVIAL-REWRITE(8) A sender-dependent override for the global relay- host parameter setting. + Available in Postfix version 2.5 and later: + + empty_address_relayhost_maps_lookup_key (<>) + The sender_dependent_relayhost_maps search string + that will be used instead of the null sender + address. + ADDRESS VERIFICATION CONTROLS Postfix version 2.1 introduces sender and recipient address verification. This feature is implemented by diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index d39222ab1..bc75192dd 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -1212,6 +1212,13 @@ for \fBshowq\fR(8) queue displays. The recipient of mail addressed to the null address. Postfix does not accept such addresses in SMTP commands, but they may still be created locally as the result of configuration or software error. +.SH empty_address_relayhost_maps_lookup_key (default: <>) +The sender_dependent_relayhost_maps search string that will be +used instead of the null sender address. +.PP +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. .SH enable_errors_to (default: no) Report mail delivery errors to the address specified with the non-standard Errors-To: message header, instead of the envelope diff --git a/postfix/man/man8/trivial-rewrite.8 b/postfix/man/man8/trivial-rewrite.8 index 7252e4388..200891de0 100644 --- a/postfix/man/man8/trivial-rewrite.8 +++ b/postfix/man/man8/trivial-rewrite.8 @@ -172,6 +172,11 @@ Available in Postfix version 2.3 and later: .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. .SH "ADDRESS VERIFICATION CONTROLS" .na .nf diff --git a/postfix/mantools/postlink b/postfix/mantools/postlink index 8f7b43c47..ea5f9d3f2 100755 --- a/postfix/mantools/postlink +++ b/postfix/mantools/postlink @@ -379,6 +379,7 @@ while (<>) { s;\bsender_canonical_classes\b;$&;g; s;\bsender_canonical_maps\b;$&;g; s;\bsender_dependent_relay[-]*\n*[ ]*host_maps\b;$&;g; + s;\bempty_address_relayhost_maps_lookup_key\b;$&;g; s;\bsendmail_path\b;$&;g; s;\bservice_throttle_time\b;$&;g; s;\bsetgid_group\b;$&;g; diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index 42daf4e33..8d7423299 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -9091,6 +9091,15 @@ substitutions in regular expression maps.

This feature is available in Postfix 2.3 and later.

+%PARAM empty_address_relayhost_maps_lookup_key <> + +

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 empty

diff --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.