Re: [Exim] Transport filtering

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: jori.hamalainen
CC: exim-users
Subject: Re: [Exim] Transport filtering
On Tue, 17 Aug 2004 jori.hamalainen@??? wrote:

> in my mind the documentation about transport filtering has some
> caveats.
>
> - doc says that filter gets its STDIN before SMTP-processing, like
> turning '\n' to '\r\n'
>
> I doesn't mention, what is the input. Is it _always_ with '\n' when in
> Unix or is it _always_ '\r\n' or is it in form as the message was
> queued so I need to prepare for both line termination?


Lines are always terminated by \n internally, and it is the internal
format that you see.

> - about output, what happens to STDERR? Nothing special or going to
> exim log? Probably nothing special. I ask this because if I want to
> log something from filter to exim log.


STDERR is set to the same file descriptor as STDIN. An interface to the
log writing functions is not provided.

> - and finally exit code, can I on purpose cause bounce message by
> setting exit-code to a non-zero?


No. The transport filter is intended for making changes to messages as
they are transported. It is not intended for making decisions about the
delivery. Those decisions should be made earlier by routers or the other
kinds of filter.

If a transport filter returns a non-zero code, a temporary error occurs,
the terminating "." line is not sent (for SMTP delivery), and the
message is retried later. This is undesirable, because it means that the
outgoing SMTP connection has been dropped in the middle of sending the
DATA. Transport filters are not normally expected to fail.

I have made a note to expand the documentation on these points.

--
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