Re: [Exim] use of "first_delivery"

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Philip Hazel
Ημερομηνία:  
Προς: Marc Haber
Υ/ο: exim-users
Αντικείμενο: Re: [Exim] use of "first_delivery"
On Sat, 11 May 2002, Marc Haber wrote:

> I am an idiot. Let me re-phrase this:
>
> I have a filter file that calls a virus scanner. It looks like:
>
> |if $received_protocol is "no-scan"
> |then
> |    headers add "X-Virus-Scanned-By: Amavis with (no scanner) on ${primary_hostname} - message delivered locally"
> |    finish
> |endif
> |
> |if not first_delivery
> |then
> |    finish
> |endif
> |
> |<code to scan the message>

>
> With this system filter, is it guaranteed that the scanning code is
> run at least once on every message that comes in via a protocol that
> is not "no-scan"?


There are no guarantees in software, especially in free software. :-)

It is highly likely that what you want will occur. However, there are
circumstances where it will not. Example: message arrives, and is queued
because the load is high. Administrator (for whatever reason) kills the
message.

If you had said "at most once" or "exactly once" I would have been even
more cautious. "first_delivery" gets unset at the end of the first
delivery attempt. If the power fails just beforehand (for example), the
flag won't be in the right state when Exim returns. But "at least once"
is a pretty good bet.


--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.