Re: [Exim] ldap routing

Top Page
Delete this message
Reply to this message
Author: Marc Langer
Date:  
To: exim-users
Subject: Re: [Exim] ldap routing
On Mon, Jul 09, 2001 at 11:53:23 +0100, William Gerken wrote:
> I would like to be able to accept mail for user1@???, look up the
> mailHost and mailLocalAddress attributes, then route the message on to
> mailLocalAddress at mailHost. I would like to be able to do this for
> multiple mailHost values, including the localhost.


Here is how I have done that (Hostname, ou and o attributes changed):

# lookup domain in LDAP server
# only match entries containing mailhost=server1

local_domains = ldapm;ldap::///ou=xyz,o=abc?mail?sub?\
                (&(|(mail=*@$key)(mail=@$key)(mailalternateaddress=*@$key))\
                (mailhost=server1))


# Routers section
# Lookup mailhost, match every entry not containing mailhost=server1

ldap_route:
  driver = domainlist
  domains = ${lookup ldapm {ldap:///ou=xyz,o=abc?mailhost?sub?\
                (&(mail=@$domain)(!(mailhost=server1)))}{$domain}{}}
  route_list = "* \"${lookup ldapm {ldap:///ou=xyz,o=abc?mailhost?sub?\
                (&(mail=@$domain)(!(mailhost=server1)))}\
                {$value}{}}\" byname"
  transport = remote_smtp




Everything else is done by the directors, you probably already have.

HTH
Marc