Re: [exim] headers_remove expand with mysql fails

Inizio della pagina
Delete this message
Reply to this message
Autore: Karl-Heinz Wild
Data:  
To: exim-users@exim.org exim
Oggetto: Re: [exim] headers_remove expand with mysql fails
I still can not find a solution.

When I double the colons in the macros it doesn't work and
when I try to find what's the problem and replace all variables
in the macro it still not works.

MYSQL_ADD_WLR = \
    REPLACE whitelist_rcpt set \
        wlr_domain = 'foo', \
        wlr_user = 'bar', \
        wlr_rcpt = 'foo@bar'


Error:

58567 failed to expand: REPLACE whitelist_rcpt set wlr_domain = 'foo', wlr_user = 'bar
58567    error message: missing } at end of string
58567 failed to expand: ${lookup mysql{REPLACE whitelist_rcpt set wlr_domain = 'foo', wlr_user = 'bar
58567    error message: missing } at end of string


Thank you for you interest.
Karl-Heinz



On 04.09.2014, at 22:33, Jeremy Harris <jgh@???> wrote:

> On 04/09/14 10:08, Karl-Heinz Wild wrote:
>> I did an update from 4.82 to 4.84
>> I use in a transport the command header_removes
>> to write an ip to mysql mysql table to whitelist an
>> ip.
>>
>> This method doesn't work since the update.
>>
>> The command looks like
>>
>>  remote_smtp:
>>    driver = smtp
>>    headers_remove  = ${lookup mysql{MYSQL_ADD_WLR}}
>>    ...

>>
>> The macro for the sql
>>
>>  MYSQL_ADD_WLR = \
>>    REPLACE whitelist_rcpt set \
>>        wlr_domain = '${quote_mysql:$sender_address_domain}', \
>>        wlr_user = '${quote_mysql:$sender_address_local_part}', \
>>        wlr_rcpt = '${quote_mysql:$local_part}@${quote_mysql:$domain}'

>
> Yes. This option is defined as taking a colon-separated
> list, and the operation was subtly changed between those
> releases to expand each list item separately. You've
> fallen foul of that because your text includes colons.
>
> You could abuse a different option (current_directory might
> work, being pointless for an smtp transport).
> --
> Cheers,
> Jeremy
>
>
>
> --
> ## List details at https://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/