> On Mar 28, 2016, at 10:15 AM, Pedro David Marco <pedrod_ma...@yahoo.com> > wrote: > > It seems to me that when qmgr wants to deliver an email via smtp, qmgr > "assigns" it to a smtp process. As long as there are no concurrency > needs, the same smtp process is used repeatedly.... even for diferent > domain destinations.
This impression is incorrect. Deliveries are handled by the first idle smtp(8) delivery agent, or if none are idle, a new one is spawned, up to the process limit specified in master.cf or the default process limit. There is no prior "assignment". Each smtp(8) delivery agent handles one request at a time, and goes back for more when it is done. The main complication is there are also per-nexthop destination concurrency limits, so messages for a busy destination may need to wait for delivery of other messages for the same destination when the concurrency limit is reached. Similarly, once the process limit is reached, and all delivery agents are busy, new mail waits for other deliveries to complete. > NOW, if one smtp process delivery takes long, long long... until > it dies for the watchdog timeout, Watchdog timeouts are not normal Postfix behaviour. They are a last-resort safety measure in the face of kernel bugs or execution on platforms that are not sufficiently compatible with Postfix. If you're seeing watchdog timeouts, there's something wrong with your system. > all smtp deliveries assigned to that smtp process fail! and > qmgr send them back to deferred queue.... Exactly one delivery is "assigned" to a busy smtp(8) delivery agent. No other deliveries wait for that agent specifically. However, if you restart the queue manager (via Postfix reload or similar) it will not be able to obtain an exclusive lock on a queue file that is open by a running delivery agent. In that case, other recipients from the same queue file may be blocked until the pending delivery completes. This does not affect the delivery of new mail. DO NOT make a habit of restarting the queue manager. In particular, avoid routine use of "postfix reload" from cron. > Is there any way to force postfix to use one smtp process > for each delivery so if one fail the others get delivered? The premise if flawed, so the question is moot. Postfix uses multiple processes in parallel by default. -- Viktor.