On Sat, Mar 12, 2016 at 01:14:17AM -0800, Robert Wolfe wrote: > "I read that postifx will retry emails for 5 days before it will stop and > email will be removed from the queue. That is too much.
https://tools.ietf.org/html/rfc5321#section-4.5.4.1 Retries continue until the message is transmitted or the sender gives up; the give-up time generally needs to be at least 4-5 days. It MAY be appropriate to set a shorter maximum number of retries for non- delivery notifications and equivalent error messages than for standard messages. The parameters to the retry algorithm MUST be configurable. This advice should be taken seriously. However, in some environments it is also important to notify the sender that their email did not get through in a timely manner. Therefore, reducing that timeout to 2-3 days is not unreasonable, in combination with http://www.postfix.org/postconf.5.html#delay_warning_time # Warn sender of trouble after 2 hours, continue to retry for 2 days # delay_warning_time = 2h maximal_queue_lifetime = 2d > "I want to set email delivery to be retried only 3 times before it is > removed from the queue permanently. And maximum time email should be in > queue should be only 3 hours. This is a bad idea, and if the OP's organization is spamming and cares not for the delivery of their email, they can use some other MTA. People who ask for short queue lifetime generally have some other problem they've failed to describe or address. The best thing is to ask them what their real problem is, though it is possible they have OCD and want to tune the queue lifetime "just because"... Postfix will only give up after a failed delivery that occurs at least maximal_queue_lifetime after the message is received. If the mail queue has a multi-day backlog, this could in principle be multiple days after the configured maximal_queue_lifetime. > How do I set or configure the maximum delivery retry times/duration for > emails in queue." The relevant parameters are http://www.postfix.org/postconf.5.html#maximal_queue_lifetime http://www.postfix.org/postconf.5.html#bounce_queue_lifetime http://www.postfix.org/postconf.5.html#delay_warning_time http://www.postfix.org/postconf.5.html#maximal_backoff_time For queue tuning advice, users should consult: http://www.postfix.org/QSHAPE_README.html -- Viktor.