Re: [exim] Making 'warn' errors fatal

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Fred Viles
Date:  
À: exim-users
Sujet: Re: [exim] Making 'warn' errors fatal
On 18 Jul 2005 at 12:59, Alan J. Flavell wrote about
    "Re: [exim] Making 'warn' errors fat":


| On Mon, 18 Jul 2005, Brian Candler wrote:
| 
| > I have an entry in my DATA ACL condition like this:
| > 
| >   warn
| >     message = X-Virus-Warning: This message contains malware ($malware_name)
| >     malware = *
| > 
| > I find that if the virus scanner is down, the message is accepted (250 OK).
| > It seems that Exim considers failures in 'warn' sections to be non-fatal.
| > 
| > I would like the message to be rejected with 4xx in this case.
| 
| Use "defer" ("deny" would produce a 5xx rejection).


It's not quite that simple, since Brian doesn't want to defer when
the scanner *is* running.

Set an acl variable after the malware=* in the warn stanza, then add
a defer stanza following the warn which is conditioned on the acl
variable not being set. Something like (untested):

   warn
     message = X-Virus-Warning: This message contains malware ($malware_name)
     malware = *
     set acl_m0 = scanned


   defer
     condition = ${if eq{$acl_m0}{scanned}{no}{yes}}
     malware = *


- Fred