RE: [Exim] Virtual Domains (now with mysql)

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Philip Hazel
Dátum:  
Címzett: Jonathan Gilpin
CC: 'exim-users@exim.org'
Tárgy: RE: [Exim] Virtual Domains (now with mysql)
On Thu, 30 Sep 1999, Jonathan Gilpin wrote:

> "is. Check out the *@ option of single key lookup types in section 6.1 of
> the 3.00 manual, and also include_domain and qualify_preserve_domain in
> the aliasfile director (section 21.7)."
>
> Can I do this in Mysql?


That depends entirely on the functionality of Mysql, about which I know
very, very little.

> like to get exim to re-query with:
>
> query = "select destination from vitals where emailaddress='*@$domain'"


The way to do this is to use the "queries" option instead of "query".
This allows you to specify a list of queries to try in order.

> Something like "search_type = mysql*@" perhaps?


Exim cannot do that kind of thing for query languages. It requires too
much knowledge of the query language, which is why I left it to admins
to set up for themselves. (In principle a query language could have
inbuilt features for this kind of thing.)

> On final comment is that I would like to get exim to query the mysql
> database to get its
> list of local_domains. Is this possible?


Of course.

local_domains = mysql;select whatever from whatever

See the definition of "domain list".

> I guess I need to look at the use of regular expressions in exim so I will
> do that next...


Not necessary for lookups.

> As a side note initially I had three fields in Mysql for the email address
> being sent to.
>
> value    subdomain  domain
> jonathan test       nildram.co.uk

>
> for
> jonathan@???
>
> I wanted to do something like:
>
> query = "select destination from user where value='$local_part' and
> subdomain='$subdomain' and domain='$domain'"
>
> can I use a regular expression to split this up?


I don't fully understand your question, but there is no such variable as
$subdomain. However, you could use a regex to split up
"test.nildram.co.uk" into separate parts if you wanted.



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