Re: [exim] reaction on a failed transport_filter

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: exim-users
CC: exim-users
Subject: Re: [exim] reaction on a failed transport_filter
On Sun, 19 Dec 2004 exim-users@??? wrote:

> > address_file:
> >   driver = appendfile
> >   delivery_date_add
> >   envelope_to_add
> >   return_path_add
> >   transport_filter = /usr/local/lib/eagleeye/filter-feedback.pl \
> >                      $message_id

> >
> > When the transport_filter's exit code is non-zero, indicating an error, the
> > message gets stuck on the queue:
> >
> > 2004-12-10 19:13:37 +0100 1CcpBY-000BJu-Q3 ==
> > /var/spool/eagleeye/ham/eagleeye-ham.mbox <ham@???>
> > R=system_aliases T=address_file defer (-24): filter process failure 1 while
> > writing to /var/spool/eagleeye/ham/eagleeye-ham.mbox
> >
> > Is there a way I can ignore such errors and simply discard the message?


There is a way you can ignore such errors. Just write a wrapper for your
filter that always returns a zero return code. Exim will then think it
has delivered the message. What will actually have happened to it
depends entirely on what the filter has done to it. You may end up with
an empty message in the mailbox. I suspect this is not a good idea.

> > If not, how can I quickly delete them from the queue? There's no
> > need to inform the original sender via a bounce. I'm running exim
> > v4.43.


If you can find some way of identifying the message, you can arrange for
it to be discarded next time by writing suitable tests in a system
filter file, or in a condition condition on a router. You could even
have your filter (or a wrapper) update a list of messages that Exim
could consult - but if you do this, take care to think about locking
issues.

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