Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

ldap look ups

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


kyle.king at quentustech

Feb 3, 2012, 12:11 PM

Post #1 of 3 (613 views)
Permalink
ldap look ups

I am trying to set up my MTA server so that it will deliver all mail in
which there is a ldap group with atributs to the following, "(cn=domain)
and (member=local_part)". I have read through
http://www.exim.org/exim-html-current/doc/html/spec_html/ch09.html and
ask on IRC, but was not able to find the information I needed. Am I
misunderstanding/overlooking the documentation on this subject, or am I
going about this all wrong?

--
Kyle A. King
Quentus Technologies, INC
Cell: 703-635-9512
Work: 253-218-6030
Fax: 206-462-1861
Email: kyle.king [at] quentustech


--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


kyle.king at quentustech

Feb 3, 2012, 12:48 PM

Post #2 of 3 (594 views)
Permalink
Re: ldap look ups [In reply to]

I have set up so that the domain is found in ldap but still unsure, how
to search that an ldap object has a set value. I know in postfix this is
done by searching for (&(cn=%d)(member=%u)).

Kyle A. King
Quentus Technologies, INC
Cell: 703-635-9512
Work: 253-218-6030
Fax: 206-462-1861
Email: kyle.king [at] quentustech


On 02/03/2012 12:11 PM, Kyle King wrote:
> I am trying to set up my MTA server so that it will deliver all mail in
> which there is a ldap group with atributs to the following, "(cn=domain)
> and (member=local_part)". I have read through
> http://www.exim.org/exim-html-current/doc/html/spec_html/ch09.html and
> ask on IRC, but was not able to find the information I needed. Am I
> misunderstanding/overlooking the documentation on this subject, or am I
> going about this all wrong?
>

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


exim-users at spodhuis

Feb 4, 2012, 4:45 PM

Post #3 of 3 (592 views)
Permalink
Re: ldap look ups [In reply to]

On 2012-02-03 at 12:48 -0800, Kyle King wrote:
> I have set up so that the domain is found in ldap but still unsure, how
> to search that an ldap object has a set value. I know in postfix this is
> done by searching for (&(cn=%d)(member=%u)).

Globally set ldap_default_servers to point to the default list of
servers.

Figure out which attributes you want. That's the attribute list. If
you specify only one, then you get back just a value; if you specify
none, or more than one, then you get back multiple attributes in
key="value" format, so you can use ${extract...} with the results.

${lookup ldap {ldap:///cn=groups,dc=example,dc=org?homeDirectory,mail?sub?(&(cn=${quote_ldap:$domain})(member=${quote_ldap:$local_part}))}}

That is the query. If you specify it as the value of the "condition"
rule on a Router, then the Router will only take the message if the
query returns a non-empty string (ie, there were matches).

You can repeat the query, and as long as it's the same, and run in the
same process, the result will be taken from a small in-memory cache.
Often, folks define a macro at the start of the file, so that they can
then do something like:

${extract{homeDirectory}{QUERY_LDAP_GROUP}}

and rely upon the cached query. If you later want to optimise things,
once you understand things better, then you can do the query in an ACL
and set an $acl_m_foo variable which you can reference; that variable is
stored with the message, so you *never* repeat the LDAP query, even when
running in a different delivery process. (Of course, then bad LDAP data
which wedges messages in a queue is harder to fix, as opposed to just
fixing the LDAP data and letting a queue run pick up the fixed data).

What exactly you do with the data depends on what you're trying to do:
send it to an interior mail-host, deliver it to a per-user mailbox, etc.
There are "redirect" and "accept" drivers for the Routers which will
handle those two cited examples. You still need to specify what you
want done with the mails. You don't give enough information for me to
help with that.
--
https://twitter.com/syscomet

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.