[exim] virtual aliases and ldap

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Jonas Meurer
Fecha:  
A: exim-users
Asunto: [exim] virtual aliases and ldap
hello,

my exim4 has routers configured to use virtual mail accounts that are
stored in ldap, and i would like to add support for virtual mail aliases
in ldap too.

currently the config includes the following:

---snip macros at beginning---
ldap_default_servers = 127.0.0.1::389
BASEDN = ou=mail,ou=accounts,dc=resivo,dc=mejo,dc=net

GET_ADDRESS_DATA = ${lookup ldap {ldap:///BASEDN??sub?(&(uid=${quote_ldap:$local_part}@${quote_ldap:$domain}))}}
---snip---

---snip routers---
lookup:
driver = redirect
address_data = GET_ADDRESS_DATA
# data is intentionally left blank so that the router will decline
# we just want this router to do a lookup so the results are availble
# for the other routers.
data =

virtual_ldap_delivery:
debug_print = "R: virtual_ldap_delivery for $local_part@$domain"
driver = accept
condition = ${if match {${extract{mail}{$address_data}}}{$local_part@$domain} {1}{0}}
user = mail
group = mail
transport = maildir_virtual
---snip---

---snip transports---
maildir_virtual:
debug_print = "T: maildir_virtual for $local_part@$domain"
driver = appendfile
directory = ${extract{mailMessageStore}{$address_data}}
delivery_date_add
envelope_to_add
return_path_add
maildir_format
mode_fail_narrower = false
---snip---


this works quite well so far, but i'm not sure about how to add support
for aliases. i already tried the following router, but it doesn't work:
---snip routers---
virtual_ldap_aliases:
debug_print = "R: virtual_ldap_aliases for $local_part@$domain"
driver = redirect
allow_defer
allow_fail
condition = ${if match {${extract{uid}{$address_data}}}{$local_part@$domain} {1}{0}}
data = ${extract{mailAlias}{$address_data}}
qualify_preserve_domain
no_more
---snip---

do you have some hints about what's wrong with my virtual_ldap_aliases
router? i placed it directly behind the virtual_ldap_delivery router,
but so far it doesn't work.

an example alias entry in ldap looks like follows:
dn: uid=alias@???,ou=aliases,ou=mail,ou=accounts,dc=resivo,dc=mejo,dc=net
        objectClass: inetOrgPerson
        objectClass: mailAlias
        uid: alias@???
        sn: alias
        cn: alias
        mailAlternateAddress: jonas@???


where is my mistake?

bye
jonas