Re: [Exim] LDAP and addresslist

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Paul Christie
CC: exim-users
Subject: Re: [Exim] LDAP and addresslist
On Mon, 6 Nov 2000, Paul Christie wrote:

> Does the query need to return a list of addresses, or does it just need to
> return some data? In other words is this sort of thing possible.
>
> course_lists:
>   driver = forwardfile
>   domains = courses.anaheim.bath.ac.uk
>   no_more
>   senders = ldap;ldap:///o=bath.ac.uk?mail?sub?\
>      (&(uid=\${local_part:\$sender_address})(employeetype=staff))
>   file = /opt/lists/${uc:local_part}
>   forbid_pipe
>   forbid_file
>   no_check_local_user


Two different types of lookup are possible here.

1. In the particular case of an option such as "senders", which is
pre-expanded before being interpreted as a list, you could use the
string expansion to make it give a list of addresses. The syntax is them
something like this:

senders = ${lookup ldap {ldap://....}{$value}}

The result of such a lookup would have to be a colon-separated list of
senders.

2. For list entries that use the "lookup-type;lookup-data" as a list
entry (such as your example), the data that is looked up is not used (it
is saved, however, for the special cases of $domain_data and
$local_part_data, which do not apply here). This applies whether the
list is pre-expanded (like "senders") or not (like "local_domains").

3. In your example, as long as the lookup produced something, the sender 
would match. There is no need to put the \$ before the internal 
expansions. These might as well be substituted at the outer level - 
those variables won't change. If you leave the \$ in, then you will have 
to double the colon - indeed, you need to double the colon after ldap: 
anyway.    Hmm. This messing around with \$key is too contorted. I'll 
see if I can improve matters in that regard.


4. You have missed out a $ before local_part in the setting of "file".


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.