Dear developers, 

The default placeholder, %m, in LDAP query filter will generate unwanted query 
values (e.g. @.domain.ltd, @domain.ltd, @.),  and no exact domain name (without 
prepended '@'). It would be great to support placeholders %u and %d in LDAP 
query_filter.

- %u: local part of email address. e.g. replaced by 'username' if email address 
is '[email protected]'.
- %d: domain part of email address. e.g. replaced by 'domain.ltd' if email 
address is '[email protected]'.

With these two new placeholders, we can clearly query mail user and mail domain 
in ldap filter. e.g.

- (&(objectClass=amavisAccount)(mail=%u@%d))
- (&(objectClass=amavisAccount)(domainName=%d))

Attachment is my dirty patch (i don't know Perl) for amavisd-new-2.8.0-pre7, 
tested and works for me.

----
Zhang Huangbin

iRedMail: Open Source Mail Server Solution for Red Hat Enterprise Linux,
CentOS, Scientific Linux, Debian, Ubuntu, Mint, Gentoo, openSUSE,
FreeBSD, OpenBSD: http://www.iredmail.org/

Attachment: ldap_placeholders_u_d_in_query_filter.patch
Description: Binary data

Reply via email to