I found that
when the number of deferred messages grow, postfix qmgr is prone to "pile up" the mails and active them all at once. Since I have control the rate and connection features like this:
Code:
initial_destination_concurrency = 1
default_destination_concurrency_limit = 1
smtp_destination_concurrency_limit = 1
in_flow_delay = 3s
default_process_limit = 80
maximal_queue_lifetime = 10d
# smtp_connection_cache_reuse_limit = 5s
smtp_connection_cache_reuse_limit = 5
smtp_connection_cache_time_limit = 1s
smtp_connection_cache_on_demand = no
smtp_connection_cache_destinations = sina.com
The 1st section limit to 20 mails/min to a destination, because most large site such as 163, yahoo, sina, sohu ... ask for this, otherwise many mails will be bounced while the mail was generated by a PHP program(to send confirm mails to registered users); and the 2nd makes the smtp process not reuse the connections, otherwise some site will bounce the mail with "too many letters during this connections".
But
when mails to some site such as sina.com was not fast, these mails start to be deferred, at last I found in the maillog that qmgr active all of these mails just in several seconds.
Code:
Nov 22 09:43:17 PTZXMAIL postfix/qmgr[12331]: 7FEE6A2A034: to=<xxxx@sina.com>, relay=none, delay=474849, status=deferred (delivery temporarily suspended: lost connection with sinamx.sina.com.cn[202.108.3.187] while sending DATA command)
Just in this
one second, I have found 225 such records, the most I have found is that 4700 records during maybe 4~5s.
Since I have limit the rate to a destination, why still postfix do this?
What about the defers between smtp & qmgr? since qmgr just manage the queue, why does it reposrt "lost connection"?
Thanks.