Re: [exim] DB lookup caching and multiple columns/fields

Top Pagina
Delete this message
Reply to this message
Auteur: Robert Blayzor
Datum:  
Aan: Graeme Fowler
CC: exim-users@exim.org
Onderwerp: Re: [exim] DB lookup caching and multiple columns/fields
On Nov 27, 2012, at 9:36 AM, Graeme Fowler <graeme@???> wrote:
> You need something like this at an appropriate point in your ACL flow,
> which sets an ACL variable:
>
>  set acl_m1 = ${lookup mysql{select id,mailhome from usermap where \ 
>                 mailname = '${quote_mysql:$local_part}'}{$value}fail}

>
> then later you can use the "extract" function to query that data as
> follows:
>
> ${extract {mailhome}{$acl_m1}}



Ok, got it.

Does caching not work if you use the SQL in a macro? or does caching only happen using a ACL variable? I assume the ACL variable that was expanded can be used in routers and transports?


ie:

Q_USER_HOME = SELECT * FROM \
sp_eximlookup('${quote_pgsql:$domain}', '${quote_pgsql:$local_part}') \
WHERE sp_eximlookup IS NOT NULL LIMIT 1


--
Robert Blayzor
INOC, LLC
rblayzor@???
http://www.inoc.net/~rblayzor/