Re: [Exim] $recipients in a system filter doesn't seem to wo…

Top Page
Delete this message
Reply to this message
Author: Kai Henningsen
Date:  
To: Philip Hazel
CC: bauer, exim-users
Subject: Re: [Exim] $recipients in a system filter doesn't seem to work?!
On 11 May 2000, at 10:09, Philip Hazel wrote:

> On Tue, 9 May 2000, Kai Henningsen wrote:
>
> > # exim filter
> >
> > if $received_protocol is not "scanmails" and first_delivery
> > then
> >    if "$sender_address" is "" then
> >       pipe "/usr/sbin/scanmails -oMr scanmails -f '<>' -bm $recipients"
> >    else
> >       pipe "/usr/sbin/scanmails -oMr scanmails -f $sender_address -bm $recipients"
> >    endif
> > endif

> >
> > Here's the debug output:
>
> > shell pipe command before expansion:
> > /usr/sbin/scanmails -oMr scanmails -f $sender_address -bm $recipients
> > address_pipe transport returned FAIL
> > post-process |/usr/sbin/scanmails -oMr scanmails -f $sender_address -bm $recipients
> > LOG: 0 MAIN
> > ** |/usr/sbin/scanmails -oMr scanmails -f $sender_address -bm $recipients
> <message filter> T=address_pipe: Expansion of command
> "/usr/sbin/scanmails -oMr scanmails -f $sender_address -bm $recipients"
> in address_pipe transport failed: unknown variable name "recipients"
>
> The problem is that $recipients is available only in the system filter,
> but the "pipe" command does not expand its argument in the filter. It
> saves it up and expands it later when it is about to run the pipe.
>
> You must have set use_shell in your address_pipe transport. It turns out


Right. In this case, I can turn it off (thanks to the specific
transport being configurable - so the one that needs the shell can be
different from the one used by the system filter. Good work!).

> I have made a note to fix this in due course. Meanwhile, if you turn off
> use_shell it should work - but then $recipients will be all one argument
> instead of many. (However, if it did work, you could have problems with
> recipients that contain shell metacharacters.)


Hmm. It's supposed to get fed back to Exim once the pipe is done -
but I expect the final parameter expansion in the script ought to
take care of that ... or at least I can probably fix it to work that
way, if it doesn't already.

Thanks.


Regards - Kai Henningsen

-- 
http://www.cats.ms
Spuentrup CTI       Fon: +49 700 CALL CATS (=22 55 22 87)
Windbreede 12       Fax: +49 251 322312 99
D-48157 Muenster    Mob: +49 161 322312 1
Germany             GSM: +49 171 7755060