Re: [exim] Exmaple config for Exim and LDAP?

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Nigel Wade
Ημερομηνία:  
Προς: Exim users list
Υ/ο: Barry Flanagan
Αντικείμενο: Re: [exim] Exmaple config for Exim and LDAP?
Barry Flanagan wrote:
> Hi,
>
> I am trying t oget a fairly simple EXIM/LDAP system up and running but
> have been unable to find any usable config files.
>
> The set up is simple: 1 domain looking to LDAP for mail users, aliases,
> quota (and later smtp-auth, but that is not critical).
>
> I am using Exim 4.42 on Suse 9.1, and OpenLDAP 2.x
>
> Could someone point me in the direction of a working example config for
> such a setup?
>
> Thanks in advance!
>
> -Barry Flanagan
>



I don't know of any working example configs. which you can get hold of.
The Fine Manual (http://www.exim.org/exim-html-4.40/doc/html/spec.html)
shows examples of how to perform lookups from an LDAP directory.

Without knowing what you actually want to lookup in the directory it's
difficult to offer help.

In my LDAP directory I have created an account type with a "mail"
attribute which I use to indicate whether that account is a valid mail
recipient. So, to test for a valid recipient in the localuser router I
have the condition:

condition = ${if eq {1} {${lookup ldap { \
         user=LDAPU pass=LDAPP LDAPS\
         mail?sub?(&(objectClass=rsppgAccount)(uid=${quote_ldap:$local_part}))} \
         {$value} fail}} {1} {0} }


where LDAPU, LDAPP and LDAPS are the LDAP bind uid, password and URI
respectively.

This checks that a recipient isn't blocked, before doing a lookup for
any aliases :

   condition = ${if ! eq {0} {${lookup ldap { \
         user=LDAPU pass=LDAPP LDAPS\
         mail?sub?(&(objectClass=rsppgAccount)(uid=${quote_ldap:$local_part}))} \
         {$value} }} {1} {0} }
   data = ${lookup ldap { \
             user=LDAPU \
             pass=LDAPP \
             LDAPS\
             rfc822mailMember?sub?(&(objectClass=nisMailAlias)(cn=${quote_ldap:$local_part}))} \
             {$value} fail}



-- 
Nigel Wade, System Administrator, Space Plasma Physics Group,
             University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@???
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555