Re: [exim] headers_remove expand with mysql fails

Top Page
Delete this message
Reply to this message
Author: Jeremy Harris
Date:  
To: exim-users
Subject: Re: [exim] headers_remove expand with mysql fails
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