I have some basic questions regarding SMTP connections, particularly for Postfix but would appreciate advice for MS Exchange too:
- When a single relay for a given remote domain becomes unavailable, how frequently does a postfix mta that is sending mail to that domain check back to see if the service is available?
- Are failed connections "remembered" (ie cached) at all?
- Does postfix ever check to see if "lower priority" relays are online while a "higher priority" relay is available?
- Are either of the above tunable in postfix?
Disclaimer: this answer only use some postfix documentation in the internet, so perhaps I missed some facts here. For better and precise documentation, feel free to post the question in postfix mailing-list (Wietse Venema is active person in that list) or look in postfix source code.
All above question is focused on postfix backoff algorithm. First, I'll try to address the dead destionation issue
Here the relevant portion of
man 8 qmgr
Based on above, postfix indeed has cache for dead destination host. To control this behavior, please adjust
qmgr_message_recipient_limit
parameter.So when postfix check if host is alive? Postfix only try to connect to the host if there are message in active queue which has destination on it. Other than that, postfix won't actively checks if the host come back alive.
Postfix only checks lower priority MX host, if primary host is unavailable or postfix get error code 4xx from the remote host. Other MTAs behave differently when they get 4xx-error code, as they may never try to connect to secondary MX host as long as MTA can connect to primary host. See: postfix destination full/busy/error try another destination and Exchange don't send email to second MX
Regarding the message retry time, postfix will put message to deferred queue if it fails to deliver it until
bounce_queue_lifetime
(for bounce generated by postfix) ormaximal_queue_lifetime
(for the others). As said above, postfix only redeliver again if qmgr put it in active queue. Here the relevant excerpt from postfix docs about postfix scheduling algorithm.So, if you want to tuning retry time, feel free to play with parameter minimal_backoff_time, maximal_backoff_time and queue_run_delay.