Re: [exim] LDAP lookup and cocanation

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Ben Wheare
Data:  
Para: exim-users
Assunto: Re: [exim] LDAP lookup and cocanation
John Robinson wrote:
> On 29/11/2006 14:31, Ben Wheare wrote:
>> Email is delivered to joe.bloggs@domain (the form firstname.surname@domain)
>>
>> I want Exim to receive this mail, do an LDAP lookup for the record that
>> matches firstname=joe AND surname=bloggs and return the field
>> userid=jbloggs, so that I can deliver mail to the maildir
>> /maildirs/{userid}/.
>>
>> I've got it delivering mail to maildirs, and creating the maildirs on
>> the fly, using a a file and lsearch. What I want to do now is extend
>> that to LDAP and firstname.surname expansion.
>>
>> Anyone have any pointers?
>
> Can't help with that - apart from pointing you to the documentation at
> http://www.exim.org/exim-html-4.63/doc/html/spec_html/ch09.html#SECTldap
> - but unless your organisation is very small and you're absolutely sure
> you'll never have 2 "Joe Bloggs", you probably want to be using
> something else e.g. look up mailalias="joe.bloggs" to find
> userid=jbloggs, so the second Joe Bloggs can get
> mailalias="joe.bloggs.too" and userid=jbloggs2 or whatever.


Thanks for your responses everyone, I should have thought of that!

I think I've got the gist of it now:

To look up mailalias, and return user id, I'd want something like:

${lookup
ldap{ldap:///mailalias=$local_part,ou=Users,dc=domain,dc=net?userid}}

Could I do this:
[in transport]
...
maildir_format
directory = /maildirs/${lookup
ldap{ldap:///mailalias=$local_part,ou=Users,dc=domain,dc=net?userid}}/
...
?

Unfortunately I can't test it yet as we're still in the process of
setting LDAP up here, I just want to be sure I know how to sort Exim out
first.


Ben