Re: [Exim] Exim & MySQL

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Philip Hazel
Date:  
À: William Thompson
CC: exim-users
Sujet: Re: [Exim] Exim & MySQL
On Mon, 5 May 2003, William Thompson wrote:

> Nevermind, I found my mistake here...  I can't do this.  I wish there was an
> easier way.  I changed it back to my original that I was testing months ago:
> domainlist local_domains = localhost : \
>         /etc/exim4/localdomains : \
>         ${lookup mysql{select domain \
>                         from eximconf.localdomains \
>                         where enabled='yes' \
>                       } \
>                  {${sg{$value}{\N\ *\n\N}{ : }}} \
>          }

>
> Anyway of getting around using ${sg {}{}{}} here?


Not if you are going to return the list of domains like that. But why
don't you write some more complicated SQL (I can't do it for you,
because I'm not an SQL person and it would take me too long to read up
on it). I'm thinking that you ought to be able to make the SQL give you
a yes/no answer instead of a list of domains. Then you can use the

domainlist local_domains = mysql;MYSQL_QUERY

syntax. Actually, come to think of it, this should be easy. Even I can
do it. What about

domainlist local_domains = mysql;select domain from eximconf.localdomains \
where domain='$domain' and enabled='yes'

? Won't that work?

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