Re: [Exim] LDAP for Distribution lists

Top Page
Delete this message
Reply to this message
Author: Barry Pederson
Date:  
To: Joseph Kezar
CC: exim-users
Subject: Re: [Exim] LDAP for Distribution lists
Joseph Kezar wrote:
>
> Why doesn't this work? I want to return all the results mail attributes
> where the memberOfGroup = DN of ${lookup ldapdn
> {ldap://ldap.doc.state.vt.us/??sub?(cn=${quote_ldap:$local_part})}
>
> more_aliases:
>   driver = aliasfile
>   search_type = ldapm
>   query = ldap://ldap.doc.state.vt.us/\
>     ou=People,o=Vermont Department of Corrections,c=US?mail?sub?\
>     (memberOfGroup=${lookup ldapdn
> {ldap://ldap.doc.state.vt.us/??sub?(cn=${quote_ldap:$local_part})}})
>   file_transport = address_file
>   pipe_transport = address_pipe




Your ldapdn lookup is missing the search base (ou=People,...) Are the
file_transport and pipe_transport lines necessary?

I tried a test configuration (named configure.foo) on my system with
director like this:

------------
foo:
  driver = aliasfile
  search_type = ldapm
  query = "ldap:///o=Foo?mail?sub?(uniquemember=${lookup ldapdn \
          {ldap:///o=Foo?uid?sub?(uid=$local_part)}})"
------------


and with "exim -C configure.foo -bt foobar@domain" It came back with a
whole bunch of output looking like it would deliver to all the e-mail
addresses for which a corresponding LDAP entry had an "uniquemember"
attribute with the value corresponding to the DN of the userid
"foobar". (However I didn't actually try sending any mail since I
didn't want to spam my users)

So I think what you're asking for is possible. You can use "exim -be"
to check your ldapdn and ldapm queries, by running them as lookups.

    Barry