[exim] pipe command in user filter - pleas help!

Top Page
Delete this message
Reply to this message
Author: Swantje & Michael Ludwig
Date:  
To: exim-users
Subject: [exim] pipe command in user filter - pleas help!



Hi,

I have a problem running a pipe command within a user filter.
I'm trying to set up a filter that saves the message in the
/tmp-folder and then pipes it to a bash-shell-script with
the message-id as an argument.
As described in the filter spec in 3.13, I thought I could
use $message_id as a variable which is expanded whilst the
pipe is being executed.

Here is what I have in my user .forward file:


============================================================
stargate:/home/reg #
stargate:/home/reg # cat .forward
# Exim filter

if error_message then
finish
endif

if
$header_from is "senderaddress@???" and
$header_subject contains "some string"
then
deliver reg _ AT _ swanni-und-michi.de
save /tmp/$message_id
pipe "/admin/work/myscript.sh $message_id"
endif

stargate:/home/reg #
stargate:/home/reg #
============================================================


This is what exim filter testing gives me:


============================================================
stargate:/home/reg #
stargate:/home/reg # exim -bf .forward -f Auktionsende@??? \
                     < /admin/work/email.filter
Return-path taken from "Return-path:" header line
Return-path = senderaddress@???
Sender      = senderaddress@???
Recipient   = root@???
Testing Exim filter file ".forward"


Deliver message to: reg _ AT _ swanni-und-michi.de
Save message to: /tmp/1C5fNu-0000h0-1b
Pipe message to: /admin/work/myscript.sh $message_id
Filtering set up at least one significant delivery or other action.
No other deliveries will occur.
stargate:/home/reg #
============================================================


So why does the pipe command don't use the "message_id" - or
doesn't it show up correctly displayed while testing a filter?

Thanks in advance for any help!

BTW: In the userforward router "allow_filter" is set and
nothing restricts the use of pipe commands in the exim configuration
file.

Michael