Hi Victor,

On 03/17/2013 07:38 PM, Viktor Dukhovni wrote:
[snip]
You really should not do this. Instead take the high road:

        query_filter = mailDeliveryAddress=%s
        result = mail

Will try that.

Keep in mind that there are many different LDAP email schemas and
yours may keep the additional email addresses of each user in an
differently named attribute.  The "mailDeliveryAddress" attribute
is taken from one popular schema (assuming I remembered the attribute
name correctly).

Figured that out when I could not find the "mailDeliveryAddress" attribute in the schemas present in my OpenLDAP config:

include: file:///etc/openldap/schema/core.ldif
include: file:///etc/openldap/schema/corba.ldif
include: file:///etc/openldap/schema/cosine.ldif
include: file:///etc/openldap/schema/duaconf.ldif
include: file:///etc/openldap/schema/dyngroup.ldif
include: file:///etc/openldap/schema/inetorgperson.ldif
include: file:///etc/openldap/schema/java.ldif
include: file:///etc/openldap/schema/mozillaabpersonalpha.ldif
include: file:///etc/openldap/schema/nis.ldif
include: file:///etc/openldap/schema/openldap.ldif
include: file:///etc/openldap/schema/postfix.ldif
include: file:///etc/openldap/schema/ppolicy.ldif
include: file:///etc/openldap/schema/collective.ldif

Googling around I found a small postfix.schema and used the "maildrop" attribute which works fine using this /etc/postfix/ldap-canonical.cf:

server_host = ldapi://%2Fvar%2Frun%2Fldapi
bind = yes
bind_dn = cn=Manager,dc=example,dc=org
bind_pw = 1234
search_base = ou=hosted,dc=example,dc=org
version = 3
scope=sub
query_filter = mail=%s
result_attribute = maildrop


Thanks again for your help.

Regards,
Patrick

Reply via email to