On 11/04/2015 14:20, Jeremy Harris wrote:
On 10/04/15 17:29, Paul Warren wrote:
Anyway, this is fixable if you can figure out just the right combination
of quotes and backslashes to actually get double quotes into the file:

  continue = ${run{SHELL -c 'echo  \\\"$sender_host_address\\\"
        >>$spool_directory/blocked_relay_ips; \

You could change to using a DB lookup rather than an lsearch;
then the insert could be done without involving a shell, too.

Yes, we did consider that, but it seems a bit heavy weight for a file that at any given time is likely to have at most one or two entries in it, and is effectively a single one column table.

Plus, the advantage of the plain text file is that it's really easy to remove entries from the file by hand.

Would another means, for the future, be a variant of lsearch
which specified an alternate key-terminator?

That would certainly make this case much easier.

I think my ideal solution would be built-in support for adding key/values to an lsearch format file. Automatically putting IPs/senders/recipients/users into a file under some circumstances and then altering behaviour based on the contents of those files seems to be reasonably general problem, and Exim supports it well except for the "adding to file" bit which means breaking out to the shell.

Thinking some more, you could probably just about achieve what we want using the ratelimit option with a rate of "1" and a very long time period, but it's a bit of a hack and requires special tools to remove entries from the rate limit DB.

Paul

--
## 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/

Reply via email to