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

Top Pagina
Delete this message
Reply to this message
Auteur: Philip Hazel
Datum:  
Aan: Swantje & Michael Ludwig
CC: exim-users
Onderwerp: Re: [exim] pipe command in user filter - pleas help!
On Sat, 11 Sep 2004, Swantje & Michael Ludwig wrote:

> All right. So I have the following in my filter and bash script:
>
> .forward:
> save /tmp/$message_id
>
> myscript.sh:
> email_tmp_file=/tmp/$1
> cat $email_tmp_file
>
> Now this doesn't work at all.


Sorry, I can't see what you are trying to do here. The .forward will
arrange for the message to be delivered to that file. Are you running
that script as your pipe delivery? What do you expect it to do? There
are all sorts of problems:

1. There is no guarantee that the delivery to the file will happen
before the delivery to the pipe.

2. The output from the pipe will (in the default exim configuration) be
treated as indicating an error because the return_output option is set.

> Is there some limitation within .forward files that external files
> can't be read??


No. (But I don't think you really mean that. The script is not run while
the .forward is being processed.)

> I'm don't know what is going on here...


I don't understand what you are trying to do... I think you are not
understanding the way that Exim works. Briefly:

1. It does all the routing, runs .forward files, etc, but does not at
this stage do any deliveries. In other words, it makes all the decisions
about what to do, but does not yet do anything. A pipe is a delivery,
just like saving to a file (it's "saving to a pipe"). It happens later,
along with all the other deliveries.

2. *Then* the deliveries are done. As it happens, local deliveries are
done one at a time, but there is no specification as to which order they
are done in. Remote deliveries can happen in parallel, and in principle
Exim might change one day to doing several local deliveries at once
(though that's probably unlikely). However, you cannot rely on the order
of deliveries.

3. In the default configuration, if a pipe delivery produces output,
that indicates an error, and the output is returned to the sender in a
bounce message.

If you run a complete test message delivery with debugging, and read the
complete debugging output, you will see this all happening. First
routing (decisions), then delivery (actions).


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book