Re: [exim] Trim down pgsql callouts

Top Pagina
Delete this message
Reply to this message
Auteur: Sam Smith
Datum:  
Aan: exim-users
Onderwerp: Re: [exim] Trim down pgsql callouts
Any help with this please?

On Wed, Jul 02, 2008 at 11:57:49AM +0100, Sam Smith wrote:
> I am only a month-old Exim user, and request some assistance.
>
> I am trying to setup a variable for a pgsql callout so that exim only
> calls out to postgres once per message.
>
> As you can see from the variable, it requests three fields: uid,
> username, and mailbox.
>
> When I researched online, it was suggested that formatting the query in
> this way would allow exim to read from the cache of the initial callout,
> making operations a lot faster.
>
> However, looking at postgres' log, it shows 3 callouts made at the same
> time. Is there any way to avoid this?
>
> EXAMPLE OF THE VARIABLE:
> PGS_VAR = {lookup pgsql \
>    {select mailbox,username,uid from mailtest \
>        where username='${quote_pgsql:$local_part}'}}

>
>
> EXAMPLE OF A ROUTER USING THE VARIABLE:
> db_user:
> debug_print = "R: local_user for $local_part@$domain"
> driver = accept
> domains = +local_domains
> local_parts = ${extract {username}{$PGS_VAR}}
> transport = db_mail_spool
> cannot_route_message = Unknown user : not a v_user
>
>
> Any help would be appreciated!
>
> --Sam
>
>
> --
> ## List details at http://lists.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://wiki.exim.org/