Re: [Exim] Exim & MySQL

Startseite
Nachricht löschen
Nachricht beantworten
Autor: William Thompson
Datum:  
To: Philip Hazel
CC: exim-users
Betreff: Re: [Exim] Exim & MySQL
> > 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


I tried the yes/no answer, however, when I had "and domains='$domain'",
$domain was always empty

> 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?


Tried it, and that's what I had before. I'm trying to make a generic config
which is why I had a file in there and IMO there was no reason to put
localhost in sql.

Here's what it did in my sql log:
030505 11:08:57   28199 Query       select domain from eximconf.localdomains
    where enabled='yes' and domain=''


This occured when it checked local_domains in the acl_smtp_mail acl.