Re: exit value on virus detection

From: Bjarni R. Einarsson (
Date: Fri 27 Apr 2001 - 16:21:20 UTC

On 2001-04-24, 11:20:04 (+0200), Ewald Beekman wrote:
> Hi
> Is it possible to have return a different exit value
> on detection of a virus? I am running it on a box which monitors the

Yes, use the ! modifier on the virus checking policy. From the

  "Appending an exclamation mark (!) to a policy will make it
  have the side-effect of increasing the internal "bug score"
  past the "score_bad" value, causing the program to return with
  a non-zero exit code. The panic policy will cause the program
  to terminate immediately with a non-zero exit code."

So, just use this and set score_bad to something really high.

This does have the side-effect that you won't see the difference
between clean messages and messages which have been sanitized
alot but contained no detectable viruses.

If you need to detect both and differentiate between them, then
I'd suggest a low score_bad value, no exclamation mark and
logging to standard error - then you can grab the log from stderr
and grep for virus warnings or other Evil Stuff.

Hope these suggestions help. :)

Sorry for the late reply - I'm going through my back-log of mail and
getting into gear to start improving the sanitizer some more. Lots of
good suggestions have arrived in my mailbox and I'm reaching the
point at my new job where I'll be able to justify spending time on
the sanitizer engine itself. I'm happy to say that I've received very
few bug reports in the past few months though...

Bjarni R. Einarsson                           PGP: 02764305, B7A3AB89                -><-    

Check out my open-source email sanitizer:

hosted by