Feature request and my dirty patch: placeholders %u, %d in LDAP query_filter

Zhang Huangbin zhbmaillistonly at gmail.com
Sat Jun 30 12:32:32 CEST 2012


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 'username at domain.ltd'.
- %d: domain part of email address. e.g. replaced by 'domain.ltd' if email address is 'username at domain.ltd'.

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/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldap_placeholders_u_d_in_query_filter.patch
Type: application/octet-stream
Size: 969 bytes
Desc: not available
URL: <http://lists.amavis.org/pipermail/amavis-users/attachments/20120630/e2b64da5/attachment.obj>


More information about the amavis-users mailing list