Re: [exim] String expansion from database, possible?

Góra strony
Delete this message
Reply to this message
Autor: Dean Brooks
Data:  
Dla: exim-users
Temat: Re: [exim] String expansion from database, possible?
On Tue, Nov 20, 2012 at 11:09:54AM -0500, Robert Blayzor wrote:
> I have an Exim router looking up a simple redirect from one domain to another:
>
> db_routed:
> driver = redirect
> allow_defer
> allow_fail
> domains = +db_dns
> data = ${lookup pgsql {REDIR_SQL}{$value}fail}
> user = mailnull
> group = mail
> pipe_transport = address_pipe
> file_transport = address_file
>
> The query works, and returns:
>
> $local_part@???
>
> However the "$local_part" is never expanded and is used literally... from the log:
>
> 2012-11-20 15:45:57 1Taq1N-0000LE-1P ** $local_part@??? <foo@???>: No such mailbox
>
> Does string expansion not happen on data returned by the database? ideas on what to check?


Expansion only runs once on the original string. You can force a second
expansion by using:

data = ${expand:${lookup pgsql {REDIR_SQL}{$value}fail}}

--
Dean Brooks
dean@???