Re: [Exim] transport filter arguments/exists fails?

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: John Horne
CC: Exim Users List
Subject: Re: [Exim] transport filter arguments/exists fails?
On Wed, 12 Jun 2002, John Horne wrote:

>   transport_filter = /usr/bin/spamc -f "${if exists \
>      {TABLES/spam-configs/$local_part} {-C TABLES/spam-configs/$local_part}}"

>
> fails whilst
>
>   transport_filter = /usr/bin/spamc -f -C "${if exists \
>      {TABLES/spam-configs/$local_part} {TABLES/spam-configs/$local_part}}"

>
> works fine. (I change spamc to accept -C with or without an following
> argument).


Exim splits up the command line into separate arguments *before* doing
the string expansions. This is deliberate, so that the contents of any
expansion cannot be treated as meta characters that affect the number of
arguments. [This may not be a huge issue with transport filters, but it
is important for pipe transports, where you often insert $local_part,
and don't want to have to account for special characters therein.]

The downside is that you can't use an expansion to change the number of
arguments, which is what you were trying to do.



--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.