Re: [Exim] PostgreSQL & Aliassing Again

Top Page
Delete this message
Reply to this message
Author: Nico Erfurth
Date:  
To: exim-users
Subject: Re: [Exim] PostgreSQL & Aliassing Again
Sander Smeenk wrote:
> Quoting Philip Hazel (ph10@???):
>
>
>>   data = ${lookup pgsql{SELECT destination FROM exim_user_aliases
>>   WHERE lower(localpart) = lower('${quote_pgsql:$local_part}') AND
>>   lower(owner) = lower('${quote_pgsql:$domain}') LIMIT 1}}
>>                                                         ^
>>Make use of the "lookup failed" features of Exim. Instead of ending your
>>expansion with "}}" use

>>
>> }{$value}{thisuser@???}}
>
>
> I knew about this cool feature, but I can't apply that here.
> The 'thisuser@???' might be different for each virtual domain,
> so it has to be 'looked up' in the database...


You could add a second lookup for the catchall-account in the
failed-field, this will be looked up IF the first lookup fails.
so just replace {thisuser@???} with

{${lookup pgsql {select destination from exim_user_aliases\
     where lower(localpart) == ${quote_pgsql:*} and lower(owner) =\
     ${quote_pgsql:$domain} LIMIT1}}}


ciao