Previous: , Up: Interfaces to Third-Party Programs   [Contents][Index]

5.31.2 ClamAV

Built-in Function: boolean clamav (number msg, string url)

Pass the message msg to the ClamAV daemon at url. Return true if it detects a virus in it. Return virus name in clamav_virus_name global variable.

The clamav function can signal the following exceptions: e_failure if failed to connect to the server, e_url if the supplied URL is invalid and e_range if the supplied port number is out of the range 1–65535.

An example usage:

prog eom
  if clamav(current_message(), "tcp://")
    reject 550 5.7.0 "Infected with %clamav_virus_name"