Connection caching must be used wisely. It is anti-social to
keep an unused SMTP connection open for a significant amount of
time, and it is unwise to send huge numbers of messages through
the same connection. In order to avoid problems with SMTP connection
caching, Postfix implements the following safety mechanisms:
scache(8) server keeps a connection open for
only a limited time. The time limit is specified with the
smtp_connection_cache_time_limit and with the
configuration parameters. This prevents anti-social behavior.
smtp(8) client reuses a session for only a
limited number of times. This avoids triggering bugs in implementations
that do not correctly handle multiple deliveries per session.
With Postfix 2.2 the use count is limited with the
smtp_connection_cache_reuse_limit configuration parameter. With
Postfix 2.3 this is replaced by a time limit which is specified
smtp_connection_reuse_time_limit parameter. In addition,
Postfix 2.3 logs the use count of multiply-used connections,
as shown in the following example:
Nov 3 16:04:31 myname postfix/smtp: 19B6B2900FE:
to=<[email protected]>, orig_to=<[email protected]>,
relay=mail.example.com[126.96.36.199], conn_use=2, delay=0.22,
delays=0.04/0.01/0.05/0.1, dsn=2.0.0, status=sent (250 2.0.0 Ok)
The connection cache explicitly labels each cached connection
with destination domain and IP address information. A connection
cache lookup succeeds only when the correct information is specified.
This prevents mis-delivery of mail.