Re: [Exim] String expansion problem

Top Page
Delete this message
Reply to this message
Author: Andreas Metzler
Date:  
To: exim-users
CC: Avery Fay
Subject: Re: [Exim] String expansion problem
On Fri, Jan 16, 2004 at 06:33:58AM -0500, Avery Fay wrote:
> I'm using exim 3.35 on Debian GNU/Linux.

[...]
> command = /usr/sbin/cyrdeliver -m ${if match
> {$h_X-Spam-Status:}{.*Yes.*} {Spam}{${substr_1:${local_part_suffix}}}}
> ${local_part} -e

[...]
> Expansion of "${if" from command "/usr/sbin/cyrdeliver -m ${if match
> {$h_X-Spam-Status:}{.*Yes.*} {Spam}{${substr_1:${local_part_suffix}}}}
> ${local_part} -e" in local_delivery_cyrus transport failed: condition
> name expected, but found ""

[...]

Quoting spec.txt:
| command (pipe) _option_

|
| Type: string, expanded

[...]
| The command is split up into separate arguments by Exim, and each
| argument is separately expanded, as described in section "How the
| command is run" above.


And checking the referenced section yields:

| The expansion is applied to each argument in turn rather
| than to the whole line. For this reason, any string expansion item
| that contains white space must be quoted so as to be contained within a
| single argument. A setting such as

|
|      command = /some/path ${if eq{$local_part}{postmaster}{xxx}{yyy}}

|
| will not work, because the expansion item gets split between several
| arguments. You have to write

|
|      command = /some/path "${if eq{$local_part}{postmaster}{xxx}{yyy}}"

|
| to ensure that it is all in one argument.

               cu andreas
--
"See, I told you they'd listen to Reason," [SPOILER] Svfurlr fnlf,
fuhggvat qbja gur juveyvat tha.
Neal Stephenson in "Snow Crash"