On Fri, Mar 08, 2013 at 03:45:57PM +0200, Geoff Shang wrote:

> Right now, Postfix is connecting to LDAP every time it needs to do
> one of these lookups, then disconnects again.

No Postfix release has ever done that. LDAP connections have always
been cached by the process that makes the queries. The first query
triggers a connection, subsequent queries re-use the connection.

> I thought that specifying "proxy:" in the entry might deal with
> this, but it doesn't appear to have done so.

The effect of the "proxy:" prefix is to reduce the number of
processes that make LDAP connections, by pooling all the connections
via a small number of proxy processes.

On a sufficiently idle system (say a test system which only receives
intermittent email messages) the processes that are connected to LDAP
may exit when idle for long enough, and then new connections will be
made later.  The same happens on systems where some misguidedly runs
"postfix reload" frequently.

> My question is, is it possible to get proxymap to open a persistant
> connection for LDAP to do relay_domain and relay_recipient lookups?

It is not possible to open non-persisten connections.  If the LDAP
server closes connections that the LDAP client did not actively
close, that could be a reason for connections to not stay open.

> /etc/postfix/ldap-domains.cf:
> 
> version = 3
> start_tls = no
> tls_require_cert = no
> server_host = ldap://ldap-server.ourdomain.com
> 
> /etc/postfix/ldap-users.cf:
> 
> version = 3
> start_tls = no
> tls_require_cert = no
> server_host = ldap://ldap-server.ourdomain.com

Furthermore, both tables have the same connection-related
Parameters, and so as of postfix-2.0.16-2003091 both tables
use the same LDAP connection.

    20030917

        Multiple LDAP lookup tables in the one Postfix process now
        share one LDAP connection. ...

This snapshot eventually evolved into Postfix 2.1. So Postfix 2.1
or newer supports both connection caching and connection consolidation
for multiple tables that differ only in the query paramers (search base,
scope, query, returned attributes).

The proxymap service was introduced in postfix-2.0.0-20030103.

-- 
        Viktor.

Reply via email to