OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
ldap aliases

From: Norberto Bensa (nbensagmail.com)
Date: Sat Jul 26 2008 - 10:17:34 CDT


Hello list!

I'm trying to move my aliases to ldap. It's somewhat working right now
but I have a question.

It seems that Postfix searches the database by the username part of
the email account. For example if I send email to norbertobensa.ar
(note that bensa.ar doesn't exist on the internet) Postfix checks for
"norberto" not "norbertobensa.ar"

main.cf:

alias_maps = hash:/etc/mail/aliases
                           ldap:/etc/postfix/ldap-aliases.cf

====================================================================
ldap-aliases.cf:

bind = no
server_host = ldap://127.0.0.1/
search_base = ou=users,dc=bensa,dc=ar
scope = sub
size_limit = 1
query_filter = (&(objectClass=inetLocalMailRecipient)(mail=%s))
result_attribute = mailLocalAddress

====================================================================
$ ldapsearch -x 'uid=nbensa' mailLocalAddress mail

dn: uid=nbensa,ou=users,dc=bensa,dc=ar
mail: norbertobensa.ar
mail: zoolookbensa.ar
mail: nbensabensa.ar
mailLocalAddress: nbensabensa.ar

====================================================================

If I change query_filter to "mail=%sbensa.ar" then it works, but then
I loss the ability to do virtual domains.

I'm sure I'm missing something, but I don't know what.

Many thanks in advance,
Norberto

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.