Richard Pickett: > > There are two types of connection caching. One of them is what I > > call anti-social. > > > > It would be anti-social to keep a connection open in the hope that > > you will be sending messages by quickly after each other.
The default setting is "smtp_connection_cache_on_demand = yes". With this, Postfix will keep a connection open ONLY IF THERE IS ALREADY MORE MAIL in the active queue. It is not sufficient to run a BASH script that executes the Postfix sendmail a lot of times because that is too slow to fill the queue. To trigger connection caching, you'd have to suspend delivery (as in my transport example) while filling up the queue, and then flush the queue all at once. Even then it is unlikely that you will trigger connection reuse, because flushing the queue involves a lot of disk activity, and disks are slow. When Postfix reuses a connection, it logs the "conn_use" attribute. Citing from the RELEASE_NOTES-2.3 file (Postfix 2.3 release notes): Nov 3 16:04:31 myname postfix/smtp[30840]: 19B6B2900FE: to=<wie...@test.example.com>, orig_to=<wie...@test>, relay=mail.example.com[1.2.3.4], conn_use=2, delay=0, delays=0/0.01/0.05/0.1, dsn=2.0.0, status=sent (250 2.0.0 Ok) The following two logfile fields may or may not be present: orig_to This is omitted when the address did not change. conn_use This is omitted when a connection is used once. If you look at http://www.postfix.org/CONNECTION_CACHE_README.html then you will see that Postfix actually implements the anti-social form of connection caching, but I think it is a bad idea so I did not try to make it easy to use. Wietse