Re: Fw: [Exim] local-part?

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Gavin Dunne
CC: exim-users
Subject: Re: Fw: [Exim] local-part?
On Sat, 24 Feb 2001, Gavin Dunne wrote:

> I also noticed on the mail list archive people using this:
>
> local_domains = mysql;SELECT domain FROM domains
>                                         WHERE domain = '$key'

>
> Now this doesn't make sense to me, but I am a newbie to exim
> so any clarification is appreciated...


A lookup of the "type;data..." variety does NOT perform a substitution.
It checks whether the domain in question is on a list. Consider a simple
example. Suppose there's a file called /etc/domains, containing:

domain1: some data about domain1
domain2: some data about domain2
...

Then you could set

local_domains = lsearch;/etc/domains

and Exim would check that the domain it had in its hand was one that was
a key in the list. It would NOT substitute the entire file into the
list. Nor would it substitute the data about the domain. As long as the
domain was found in the file, it would be treated as a local domain. If
the file was very long, then an indexed search such as dbm or cdb should
be used for greater speed.

MySQL and other more complicated lookups work in exactly the same way.
Exim is asking "is this domain in your list?". It is not saying "give me
a list of domains". However, for these lookups the domain name that is
being tested needs to be available, because the queries for these
lookups are in various different formats that Exim cannot predict. So,
it puts the thing it is trying to test (the domain in this case) into
$key so that you can build a query that uses it.

HTH


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