On 08/12/2016 14:28, Wietse Venema wrote:
Dominic Raferd:
I'm using Postfix 3.1.0. If a message is rejected by an onward server
with a transient error message (e.g. 421-4.7.0 'temporarily rate
limited') then my postfix immediately tries any other specified MXs per
the recipient address and if these give the same response (as they tend
to) it immediately sends using the specified smtp_fallback_relay.
Is there a way to get it instead to try again, after a delay, to the
primary onward server(s) (whether the one specified as relayhost or, if
no relayhost is specified, the MXs per the recipient address), and only
if these fail again (or after n times) then fallback?
Why not address the root cause: you are violating the receiver's
mail rate policy. You can use xxx_transport_rate_delay for a global
limit, xxx_destination_rate_delay for rate limit per destination,
or kernel-based traffic shaping.
Wietse
Yes I have spent a lot of time (too much) trying to find a way around
the root cause: this server only relays emails from the outside into our
own gmail boxes (i.e. it is for our domain routing). So despite some
ferocious filtering it seems inevitable that a good deal of what gets
through is classed by our people (and hence by gmail) as spam, hence our
server gets 'rate capped'. This isn't a problem in itself (as long as
our ip isn't actually blocked) but I would prefer to use a fallback
relay only for real 'emergencies', not in these cases.
I already have:
smtp_destination_concurrency_limit = 1
smtp_destination_concurrency_failed_cohort_limit = 10
smtp_destination_rate_delay = 3s
smtp_destination_recipient_limit = 1
Maybe I should try smtp_transport_rate_delay - a setting I did not know
about? Our inward volumes are low, I am not bothered about delays of a
few seconds in delivery times. Kernel-based traffic shaping sounds like
it would be above my pay grade...
Thanks for your input Wietse. I love the power and flexibility of
postfix, it seems to be capable of almost anything - email-wise at least ;-)