Re: [Exim] One mysql query

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Nico Erfurth
Datum:  
To: Maykel Moya, Exim-Users (E-mail)
Betreff: Re: [Exim] One mysql query
Maykel Moya wrote:

>>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.
>
>
> Nico, after read (again) the doc, I have another doubt. At the end there
> is a portion of my current config (which a took from vexim).
>
> In the router, the mysql lookup yields only one field, so the lookup
> passes it back as is.
>
> As you can see, all queries are almost the same. But if I do a query
> which yields more than one column don't know what exim will do.


As said, you can use address_data, see
http://www.exim.org/exim-html-4.30/doc/html/spec_15.html

Place this router before all the others.

get_data:
   driver = redirect
   address_data = ${lookup mysql {select f1,f2,f3 from table \
                                  where f4='x'}}
   data =


This router will set data that is associated with the currently
processed address. You can use $address_data and ${extraxt to retrieve
the columns you need.

Nico