Re: [EXIM] transport filters

Top Page
Delete this message
Reply to this message
Author: Dave C.
Date:  
To: Torsten Curdt
CC: exim-users
Subject: Re: [EXIM] transport filters

On Mon, 16 Feb 1998, Torsten Curdt wrote:

> Date: Mon, 16 Feb 1998 20:49:53 +0100 (MET)
> From: Torsten Curdt <tcurdt@???>
> To: exim-users@???
> Subject: [EXIM] transport filters
>
> As conditional rewriting depending on the destination of
> messages can't be done in an other way I thought about doing
> this by transport filters...
>
> In the transport section I defined:
>
> local_delivery:
>   driver = appendfile,
>   transport_filter = "echo LOCAL $host $host_address\
>     $sender_address $pipe_addresses |/usr/bin/tee -a /tmp/log";
>   file = /var/spool/mail/${local_part},

>
> remote_smtp
>   driver = smtp,
>   transport_filter = "echo SMTP $host $host_address\
>      $sender_address $pipe_addresses|/usr/bin/tee -a /tmp/log";

>
> Why do I get a broken pipe error ?
> Isn't this supposed to be right ?


Hrm.. One of two things. Your line beginning with LOCAL or SMTP is
coming back and is violating RFC822.. Or perhaps because wherever echo
is isn't in the PATH that is defined at the time this is called.. Its
also possible exim isnt doing shell interpretation and your "|" pipes
arent working...

I would replace them with

transport_filter="/usr/local/bin/log-transport SMTP $host\
$host_address $sender_address $pipe_addresses"

and

transport_filter="/usr/local/bin/log-transport LOCAL $host\
$host_address $sender_address $pipe_addresses"

where log-transport looks something like the following:

----------SNIP-------------
#!/bin/sh

TMP=/tmp/$PID
# (Or whatever convention you use for temporary files)

cat > $TMP

(
echo "EXIM TRANSPORT LOG $*"
cat $TMP
) > /tmp/log

cat $TMP
rm $TMP
----------SNIP-------------

This gets you using a fully-qualified path for the calls, moves the
shell syntax into a script that definately will get parsed by the
shell, and prevents outputting your "SMTP" and "LOCAL" lines back to
Exim (which is expecting only RFC822 compliant output)


--
*** Exim information can be found at http://www.exim.org/ ***