From: Wietse Venema
Postfix version 2.5 and later:
+ +In master.cf set up a dedicated clone of the "smtp" transport +for the destination in question. In the example below we will call +it "fragile".
+ +In master.cf configure a reasonable process limit for the +cloned smtp transport (a number in the 10-20 range is typical).
+ +IMPORTANT!!! In main.cf configure a large per-destination +pseudo-cohort failure limit for the cloned smtp transport.
+ ++/etc/postfix/main.cf: + transport_maps = hash:/etc/postfix/transport + fragile_destination_concurrency_failed_cohort_limit = 100 + fragile_destination_concurrency_limit = 20 + +/etc/postfix/transport: + example.com fragile: + +/etc/postfix/master.cf: + # service type private unpriv chroot wakeup maxproc command + fragile unix - - n - 20 smtp ++ +
See also the documentation for +default_destination_concurrency_failed_cohort_limit and +default_destination_concurrency_limit.
+ +Earlier Postfix versions:
+ +In master.cf set up a dedicated clone of the "smtp" -transport for the destination in question.
+transport for the destination in question. In the example below +we will call it "fragile".In master.cf configure a reasonable process limit for the transport (a number in the 10-20 range is typical).
@@ -420,16 +459,26 @@ and destination concurrency limit for this transport (say 2000)./etc/postfix/main.cf: + transport_maps = hash:/etc/postfix/transport initial_destination_concurrency = 2000 - transportname_destination_concurrency_limit = 2000 + fragile_destination_concurrency_limit = 2000 + +/etc/postfix/transport: + example.com fragile: + +/etc/postfix/master.cf: + # service type private unpriv chroot wakeup maxproc command + fragile unix - - n - 20 smtp-
Where transportname is the name of the master.cf entry -in question.
+See also the documentation for default_destination_concurrency_limit. +
+ +The effect of this surprising configuration is that up to 2000 +
The effect of this configuration is that up to 2000 consecutive errors are tolerated without marking the destination dead, while the total concurrency remains reasonable (10-20 processes). This trick is only for a very specialized situation: @@ -443,6 +492,42 @@ insert brief delays between delivery attempts.
Postfix version 2.5 and later:
+ +In master.cf set up a dedicated clone of the "smtp" transport +for the problem destination. In the example below we call it "slow". +
+ +In main.cf configure a short delay between deliveries to +the same destination.
+ ++/etc/postfix/main.cf: + transport_maps = hash:/etc/postfix/transport + slow_destination_rate_delay = 1 + +/etc/postfix/transport: + example.com slow: + +/etc/postfix/master.cf: + # service type private unpriv chroot wakeup maxproc command + slow unix - - n - - smtp ++ +
See also the documentation for default_destination_rate_delay.
+ +This solution forces the Postfix smtp(8) client to wait for +$slow_destination_rate_delay seconds between deliveries to the same +destination.
+ +Earlier Postfix versions:
+ +In the transport map entry for the problem destination, specify a dead host as the primary nexthop.
@@ -451,25 +536,28 @@ problem destination as the fallback_rel smtp_connect_timeout value.+/etc/postfix/main.cf: + transport_maps = hash:/etc/postfix/transport + /etc/postfix/transport: - problem.example.com slow:[dead.host] + example.com slow:[dead.host] /etc/postfix/master.cf: # service type private unpriv chroot wakeup maxproc command slow unix - - n - 1 smtp -o fallback_relay=problem.example.com -o smtp_connect_timeout=1 + -o smtp_cache_connection=no
This solution forces the Postfix smtp(8) client to wait for -$smtp_connect_timeout seconds between deliveries. The solution -depends on Postfix connection management details, and needs to be -updated when SMTP connection caching is introduced.
+$smtp_connect_timeout seconds between deliveries. The connection +caching feature is disabled to prevent the client from skipping +over the dead host. -Hopefully a more elegant solution to these problems will be -found in the future.
+The default amount of delay that is inserted between individual -deliveries to the same destination; with per-destination recipient -limit > 1, a destination is a domain, otherwise it is a recipient. -
- -To enable the delay, specify a non-zero time value (an integral -value plus an optional one-letter suffix that specifies the time -unit).
- -Time units: s (seconds), m (minutes), h (hours), d (days), w -(weeks). The default time unit is s (seconds).
- -NOTE: the delay is enforced by the queue manager. The delay -timer state does not survive "postfix reload" or "postfix stop". -
- -Use transport_delivery_rate_delay to specify a -transport-specific override, where transport is the master.cf -name of the message delivery transport. -
- -This feature is available in Postfix 2.5 and later.
- -This feature is available in Postfix 2.5 and later.
+ + +The default amount of delay that is inserted between individual +deliveries to the same destination; with per-destination recipient +limit > 1, a destination is a domain, otherwise it is a recipient. +
+ +To enable the delay, specify a non-zero time value (an integral +value plus an optional one-letter suffix that specifies the time +unit).
+ +Time units: s (seconds), m (minutes), h (hours), d (days), w +(weeks). The default time unit is s (seconds).
+ +NOTE: the delay is enforced by the queue manager. The delay +timer state does not survive "postfix reload" or "postfix stop". +
+ +Use transport_destination_rate_delay to specify a +transport-specific override, where transport is the master.cf +name of the message delivery transport. +
+ +This feature is available in Postfix 2.5 and later.
+ +A transport-specific override for the default_recipient_refill_delay -parameter value, where transport is the master.cf name of -the message delivery transport.
- -This feature is available in Postfix 2.5 and later.
- -This feature is available in Postfix 2.5 and later.
+ + +A transport-specific override for the default_destination_rate_delay +parameter value, where transport is the master.cf name of +the message delivery transport.
+ +This feature is available in Postfix 2.5 and later.
+ +Postfix version 2.5 and later:
+ +In master.cf set up a dedicated clone of the "smtp" transport +for the destination in question. In the example below we will call +it "fragile".
+ +In master.cf configure a reasonable process limit for the +cloned smtp transport (a number in the 10-20 range is typical).
+ +IMPORTANT!!! In main.cf configure a large per-destination +pseudo-cohort failure limit for the cloned smtp transport.
+ ++/etc/postfix/main.cf: + transport_maps = hash:/etc/postfix/transport + fragile_destination_concurrency_failed_cohort_limit = 100 + fragile_destination_concurrency_limit = 20 + +/etc/postfix/transport: + example.com fragile: + +/etc/postfix/master.cf: + # service type private unpriv chroot wakeup maxproc command + fragile unix - - n - 20 smtp ++ +
See also the documentation for +default_destination_concurrency_failed_cohort_limit and +default_destination_concurrency_limit.
+ +Earlier Postfix versions:
+ +In master.cf set up a dedicated clone of the "smtp" -transport for the destination in question.
+transport for the destination in question. In the example below +we will call it "fragile".In master.cf configure a reasonable process limit for the transport (a number in the 10-20 range is typical).
@@ -420,16 +459,26 @@ and destination concurrency limit for this transport (say 2000).
/etc/postfix/main.cf:
+ transport_maps = hash:/etc/postfix/transport
initial_destination_concurrency = 2000
- transportname_destination_concurrency_limit = 2000
+ fragile_destination_concurrency_limit = 2000
+
+/etc/postfix/transport:
+ example.com fragile:
+
+/etc/postfix/master.cf:
+ # service type private unpriv chroot wakeup maxproc command
+ fragile unix - - n - 20 smtp
-Where transportname is the name of the master.cf entry -in question.
+See also the documentation for default_destination_concurrency_limit. +
+ +The effect of this surprising configuration is that up to 2000 +
The effect of this configuration is that up to 2000 consecutive errors are tolerated without marking the destination dead, while the total concurrency remains reasonable (10-20 processes). This trick is only for a very specialized situation: @@ -443,6 +492,42 @@ insert brief delays between delivery attempts.
Postfix version 2.5 and later:
+ +In master.cf set up a dedicated clone of the "smtp" transport +for the problem destination. In the example below we call it "slow". +
+ +In main.cf configure a short delay between deliveries to +the same destination.
+ ++/etc/postfix/main.cf: + transport_maps = hash:/etc/postfix/transport + slow_destination_rate_delay = 1 + +/etc/postfix/transport: + example.com slow: + +/etc/postfix/master.cf: + # service type private unpriv chroot wakeup maxproc command + slow unix - - n - - smtp ++ +
See also the documentation for default_destination_rate_delay.
+ +This solution forces the Postfix smtp(8) client to wait for +$slow_destination_rate_delay seconds between deliveries to the same +destination.
+ +Earlier Postfix versions:
+ +In the transport map entry for the problem destination, specify a dead host as the primary nexthop.
@@ -451,25 +536,28 @@ problem destination as the fallback_relay and specify a small smtp_connect_timeout value.
+/etc/postfix/main.cf:
+ transport_maps = hash:/etc/postfix/transport
+
/etc/postfix/transport:
- problem.example.com slow:[dead.host]
+ example.com slow:[dead.host]
/etc/postfix/master.cf:
# service type private unpriv chroot wakeup maxproc command
slow unix - - n - 1 smtp
-o fallback_relay=problem.example.com
-o smtp_connect_timeout=1
+ -o smtp_cache_connection=no
This solution forces the Postfix smtp(8) client to wait for -$smtp_connect_timeout seconds between deliveries. The solution -depends on Postfix connection management details, and needs to be -updated when SMTP connection caching is introduced.
+$smtp_connect_timeout seconds between deliveries. The connection +caching feature is disabled to prevent the client from skipping +over the dead host. -Hopefully a more elegant solution to these problems will be -found in the future.
+This feature is available in Postfix 2.4 and later.
-%PARAM default_delivery_rate_delay 0s +%PARAM default_destination_rate_delay 0sThe default amount of delay that is inserted between individual deliveries to the same destination; with per-destination recipient @@ -11400,16 +11400,16 @@ unit).
timer state does not survive "postfix reload" or "postfix stop". -Use transport_delivery_rate_delay to specify a +
Use transport_destination_rate_delay to specify a transport-specific override, where transport is the master.cf name of the message delivery transport.
This feature is available in Postfix 2.5 and later.
-%PARAM transport_delivery_rate_delay $default_delivery_rate_delay +%PARAM transport_destination_rate_delay $default_destination_rate_delay -A transport-specific override for the default_recipient_refill_delay +
A transport-specific override for the default_destination_rate_delay parameter value, where transport is the master.cf name of the message delivery transport.
diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index 55cecc7dd..b8b0caf80 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -2916,8 +2916,8 @@ extern int var_conc_cohort_limit; #define DEF_CONC_FDBACK_DEBUG 0 extern bool var_conc_feedback_debug; -#define VAR_DEST_RATE_DELAY "default_delivery_rate_delay" -#define _DEST_RATE_DELAY "_delivery_rate_delay" +#define VAR_DEST_RATE_DELAY "default_destination_rate_delay" +#define _DEST_RATE_DELAY "_destination_rate_delay" #define DEF_DEST_RATE_DELAY "0s" extern int var_dest_rate_delay; diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 06bbd4200..d64340b88 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 "20080116" +#define MAIL_RELEASE_DATE "20080123" #define MAIL_VERSION_NUMBER "2.6" #ifdef SNAPSHOT diff --git a/postfix/src/oqmgr/qmgr.c b/postfix/src/oqmgr/qmgr.c index d895cc78d..e6b7a2cf0 100644 --- a/postfix/src/oqmgr/qmgr.c +++ b/postfix/src/oqmgr/qmgr.c @@ -241,11 +241,11 @@ /* undeliverable. /* .PP /* Available in Postfix version 2.5 and later: -/* .IP "\fBdefault_delivery_rate_delay (0s)\fR" +/* .IP "\fBdefault_destination_rate_delay (0s)\fR" /* The default amount of delay that is inserted between individual /* deliveries to the same destination; with per-destination recipient /* limit > 1, a destination is a domain, otherwise it is a recipient. -/* .IP "\fItransport\fB_delivery_rate_delay $default_delivery_rate_delay +/* .IP "\fItransport\fB_destination_rate_delay $default_destination_rate_delay /* Idem, for delivery via the named message \fItransport\fR. /* .SH MISCELLANEOUS CONTROLS /* .ad diff --git a/postfix/src/postconf/auto.awk b/postfix/src/postconf/auto.awk index 4b888da51..74e6401af 100644 --- a/postfix/src/postconf/auto.awk +++ b/postfix/src/postconf/auto.awk @@ -8,7 +8,7 @@ BEGIN { vars["destination_concurrency_positive_feedback"] = "default_destination_concurrency_positive_feedback" vars["destination_recipient_limit"] = "default_destination_recipient_limit" vars["initial_destination_concurrency"] = "initial_destination_concurrency" - vars["delivery_rate_delay"] = "default_delivery_rate_delay" + vars["destination_rate_delay"] = "default_destination_rate_delay" # auto_table.h diff --git a/postfix/src/qmgr/qmgr.c b/postfix/src/qmgr/qmgr.c index b3da982b1..59bafb8b6 100644 --- a/postfix/src/qmgr/qmgr.c +++ b/postfix/src/qmgr/qmgr.c @@ -287,11 +287,11 @@ /* undeliverable. /* .PP /* Available in Postfix version 2.5 and later: -/* .IP "\fBdefault_delivery_rate_delay (0s)\fR" +/* .IP "\fBdefault_destination_rate_delay (0s)\fR" /* The default amount of delay that is inserted between individual /* deliveries to the same destination; with per-destination recipient /* limit > 1, a destination is a domain, otherwise it is a recipient. -/* .IP "\fItransport\fB_delivery_rate_delay $default_delivery_rate_delay +/* .IP "\fItransport\fB_destination_rate_delay $default_destination_rate_delay /* Idem, for delivery via the named message \fItransport\fR. /* MISCELLANEOUS CONTROLS /* .ad diff --git a/postfix/src/smtp/smtp_sasl_auth_cache.c b/postfix/src/smtp/smtp_sasl_auth_cache.c index 9920850a1..682c4fba3 100644 --- a/postfix/src/smtp/smtp_sasl_auth_cache.c +++ b/postfix/src/smtp/smtp_sasl_auth_cache.c @@ -132,11 +132,12 @@ SMTP_SASL_AUTH_CACHE *smtp_sasl_auth_cache_init(const char *map, int ttl) */ #define CACHE_DICT_OPEN_FLAGS \ (DICT_FLAG_DUP_REPLACE | DICT_FLAG_SYNC_UPDATE) +#define PROXY_COLON DICT_TYPE_PROXY ":" +#define PROXY_COLON_LEN (sizeof(PROXY_COLON) - 1) - if (strncmp(map, DICT_TYPE_PROXY, sizeof(DICT_TYPE_PROXY) - 1) != 0 - || map[sizeof(DICT_TYPE_PROXY) - 1] != ':') + if (strncmp(map, PROXY_COLON, PROXY_COLON_LEN) != 0) msg_fatal("SASL authentication cache name \"%s\" must start with \"" - DICT_TYPE_PROXY "\":", map); + PROXY_COLON, map); auth_cache = (SMTP_SASL_AUTH_CACHE *) mymalloc(sizeof(*auth_cache)); auth_cache->dict = dict_open(map, O_CREAT | O_RDWR, CACHE_DICT_OPEN_FLAGS); @@ -192,9 +193,9 @@ static char *smtp_sasl_auth_cache_make_value(const char *password, return (vstring_export(val_buf)); } -/* smtp_sasl_auth_cache_valid - validate auth failure cache value */ +/* smtp_sasl_auth_cache_valid_value - validate auth failure cache value */ -static int smtp_sasl_auth_cache_valid(SMTP_SASL_AUTH_CACHE *auth_cache, +static int smtp_sasl_auth_cache_valid_value(SMTP_SASL_AUTH_CACHE *auth_cache, const char *entry, const char *password) { @@ -235,7 +236,7 @@ int smtp_sasl_auth_cache_find(SMTP_SASL_AUTH_CACHE *auth_cache, key = smtp_sasl_auth_cache_make_key(session->host, session->sasl_username); if ((entry = dict_get(auth_cache->dict, key)) != 0) - if ((valid = smtp_sasl_auth_cache_valid(auth_cache, entry, + if ((valid = smtp_sasl_auth_cache_valid_value(auth_cache, entry, session->sasl_passwd)) == 0) /* Remove expired, password changed, or malformed cache entry. */ if (dict_del(auth_cache->dict, key) == 0) diff --git a/postfix/src/util/sane_accept.c b/postfix/src/util/sane_accept.c index 613177c29..b1e6670d6 100644 --- a/postfix/src/util/sane_accept.c +++ b/postfix/src/util/sane_accept.c @@ -18,8 +18,8 @@ /* workarounds may be enabled that depend on the socket type. /* BUGS /* Bizarre systems may have other harmless error results. Such -/* systems encourage programers to ignore error results, and -/* penalizes programmers who code defensively. +/* systems encourage programmers to ignore error results, and +/* penalize programmers who code defensively. /* LICENSE /* .ad /* .fi diff --git a/postfix/src/util/sane_connect.c b/postfix/src/util/sane_connect.c index b8286a798..513f97a03 100644 --- a/postfix/src/util/sane_connect.c +++ b/postfix/src/util/sane_connect.c @@ -15,8 +15,8 @@ /* known harmless error results to EAGAIN. /* BUGS /* Bizarre systems may have other harmless error results. Such -/* systems encourage programers to ignore error results, and -/* penalizes programmers who code defensively. +/* systems encourage programmers to ignore error results, and +/* penalize programmers who code defensively. /* LICENSE /* .ad /* .fi diff --git a/postfix/src/util/sane_socketpair.c b/postfix/src/util/sane_socketpair.c index c1d3568d3..a889934c3 100644 --- a/postfix/src/util/sane_socketpair.c +++ b/postfix/src/util/sane_socketpair.c @@ -16,8 +16,8 @@ /* skips over silly error results such as EINTR. /* BUGS /* Bizarre systems may have other harmless error results. Such -/* systems encourage programers to ignore error results, and -/* penalizes programmers who code defensively. +/* systems encourage programmers to ignore error results, and +/* penalize programmers who code defensively. /* LICENSE /* .ad /* .fi