Re: [Exim] mysql lookup for relay_domains

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Brian K. West
Dátum:  
Címzett: Philip Hazel, Nancy Pettigrew
CC: exim-users
Tárgy: Re: [Exim] mysql lookup for relay_domains
You can also use:


SELECT domain FROM domain WHERE domain LIKE SUBSTRING_INDEX('$key', '.', -2)

This would allow it to be a kinda wildcard lookups

Nancy emailed me about if you had to put:

mail1.domain.com
domain.com
mail2.domain.com

in the table to make sure that it would allow any variations, I guess this
is the only way to do this! I know it works for me! unless relay_domains
will do a wildcard lookup.


Later,
Brian



----- Original Message -----
From: "Philip Hazel" <ph10@???>
To: "Nancy Pettigrew" <nancy@???>
Cc: <exim-users@???>
Sent: Friday, July 14, 2000 2:04 AM
Subject: Re: [Exim] mysql lookup for relay_domains


> On Thu, 13 Jul 2000, Nancy Pettigrew wrote:
>
> > Is this syntactically correct? (The Domains table just has a list of

all
> > the domains to relay for...)
> >
> > relay_domains = ${lookup mysql{select Domain from Domains}{$value}fail}
>
> No. What you want is
>
> relay_domains = mysql;select Domain from Domains
>
> However, the query isn't right; it should be looking up the domain you
> are interested in. Try
>
> relay_domains = mysql;select Domain from Domains where Domain="$key"
>
> The value of $key is the name of the domain you are testing.
>
> --
> Philip Hazel            University of Cambridge Computing Service,
> ph10@???      Cambridge, England. Phone: +44 1223 334714.

>
>
> --
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim

details at http://www.exim.org/ ##
>
>