> On Oct 16, 2018, at 4:50 AM, sercoinful <sercoin...@gmail.com> wrote:
> 
> server_host = ldap://ldap.xdomain.com:389
> search_base = cn=Users, dc=xdomain, dc=com
> version = 3
> query_filter = (&(objectclass=person)(mail=%s))
> result_attribute = mail
> result_format = %d/%u/
> bind = yes
> bind_dn = ad...@xdomain.com
> bind_pw = AdminTest
> 
> If I change xdomain to ydomain it also works fine. But I can't configure
> both. How can I do that? 

As described in:  http://www.postfix.org/ldap_table.5.html

   ...
   search_base = cn=Users, dc=%2, dc=%1
   domain = xdomain.com, ydomain.com
   ...

which works when the number of components in the search base is the same
for all the domains of interest.  If even that is variable, then you
need multiple tables, each with its own search base and "domain = ..."
constraint.  Since the "domain = ..." constraints quickly skip tables
that don't apply without incurring the costs of an actual LDAP lookup,
using multiple tables incurs no noticeable overhead:

    virtual_mailbox_maps =
        ldap:${config_directory}/virtual-example.net.cf,
        ldap:${config_directory}/virtual-example.org.cf,
        ...

-- 
        Viktor.

Reply via email to