Skip to content
Nigel Metheringham edited this page Nov 29, 2012 · 2 revisions

Q0025

Question

I can't seem to get a pipe command to run when I include a ${if expansion in it. This fails:

command = perl -T /usr/local/rt/bin/rtmux.pl \
            rt-mailgate helpdesk \
            ${if eq {$local_part}{rt} {correspond}{action}}

Answer

You need some internal quoting in there. Exim expands each individual argument separately. Because you have (necessarily) got spaces in your ${if item, you have to quote that argument. Try

command = perl -T /usr/local/rt/bin/rtmux.pl \
            rt-mailgate helpdesk \
            "${if eq {$local_part}{rt} {correspond}{action}}"

Warning: If command starts with an item that requires quoting, you cannot just put it in quotes, because a leading quote means that the entire option setting is being quoted. What you have to do is to quote the entire value, and use internally escaped quotes for the ones you really want. For example:

command = "\"${if ....}\" arg1 arg2"

Any backslashes in the expansion items will have to be doubled to stop them being interpreted by the string reader.


Clone this wiki locally