Re: [exim] domainlist & mysql

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Wakko Warner
Data:  
Para: Stephen Gran
CC: exim-users
Assunto: Re: [exim] domainlist & mysql
> domainlist virt_domains = mysql; select distinct domain from Virtusers

That won't work. When you use <lookup>;query like you're doing, it is only
looking for a "yes" or "no" answer (1 or more rows returned = yes, none =
no). As long as you have 1 row in Virtusers, it is always true.

> Trying this:
> domainlist virt_domains = mysql; select distinct domain from Virtusers \
>                           where domain = '$domain'

>
> works fine, but is more overhead than I would like, since it does not
> cache the entire domain list. If I dump the domains to a file, it does
> read the whole list and cache it just fine, so this leads me to the
> inevitable conclusion I am just doing somethign stupid.


Again, it's the same thing, but be careful, because if you do checking on a
sender, $domain is going to be the recipient's domain, NOT the sender's
domain.

I sucessfully did this at work using something like this:
domainlist doms = ${lookup mysql{select name from domains}{$sg{$value}{ *\\n}{:}}fail}

You might want to double check the syntax, I am not looking at the config I
used nor the spec. IIRC it does cache this!

--
Lab tests show that use of micro$oft causes cancer in lab animals