On Wed, Apr 23, 2003 at 09:38:28AM +0100, Philip Hazel wrote:
> On Tue, 22 Apr 2003, William Thompson wrote:
>
> > > data = ${lookup mysql { MYSQL_QUERY_ALIASES }}
> >
> > This looks like your problem.. try this:
> > data = ${lookup mysql { MYSQL_QUERY_ALIASES }{$value}}
> >
> > You'll need to do the same thing for the rest of the lookups as well.
> >
> > Basically, you're saying data = "" because the lookup returns information in
> > $value but you're not using it. I've been burned with this before.
>
> You must have been burned quite a while ago. For a long time now the
> default for lookups, if no strings are supplied after the lookup, is
> "{$value}". And if I recall correctly, before that you would have
> provoked a syntax error if at least one string was not provided. So I'm
> not quite sure exactly how you were burned...
I just tried this again and it didn't work. This is with 4.14.
Here's what I did:
domainlist local_domains = localhost : \
${lookup{$domain}lsearch{/etc/exim4/localdomains}} : \
${lookup mysql{select domain \
from eximconf.localdomains \
where enabled='yes' and domain='$domain' \
} \
}
When testing I see:
>>> processing "deny"
>>> check sender_domains = +local_domains
>>> electro-mechanical.com in "localhost : : "? no (end of list)
>>> electro-mechanical.com in "+local_domains"? no (end of list)
>>> deny: condition test failed
Using mysql command (using same host/user/pass as exim), I get:
mysql> select domain from eximconf.localdomains where enabled='yes' and domain='electro-mechanical.com';
+------------------------+
| domain |
+------------------------+
| electro-mechanical.com |
+------------------------+
1 row in set (0.00 sec)
mysql>
Is this something that works everywhere or just in places like "data = " ?