Re: [Exim] One mysql query

Pàgina inicial
Delete this message
Reply to this message
Autor: Nico Erfurth
Data:  
A: Maykel Moya, Exim-Users (E-mail)
Assumpte: Re: [Exim] One mysql query
Maykel Moya wrote:
> Eximers
>
> I've just installed vexim, nice to see the flexibility of ${lookup
> mysql{foo ...


vexim is abusing this flexibility, I've send comments about the horrible
use of $lookup in domainslist to Avleen Vig. He told me that he'll
change it. But the last time I've checked it wasn' in CVS.

> But, if i need to get three different data, I should do three queries,
> even if all data is in the same table, which makes possible to get them
> all in one query.
>
> Is it possible to make just a query and then instruct exim to get the
> data from the yielded row ?


for ACLs you could do:

set acl_m0 = ${lookup mysql {select f1,f2,f3 from table where f4='x'}}

and ${extract {f1}{$acl_m0}} will return the data of the first field.
In routers you can use address_data to do the same thing.

Check:
http://www.exim.org/exim-html-4.30/doc/html/spec_11.html#IX784
and
http://www.exim.org/exim-html-4.30/doc/html/spec_9.html#SECT9.17

Nico