Skip to content

Latest commit

 

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ClamAV client

Installation

Follow the instructions in our manual to add our package repository and then run the below command.

Ubuntu

apt-get install halon-extras-clamav

RHEL

yum install halon-extras-clamav

Exported functions

These functions needs to be imported from the extras://clamav module path.

clamav(fp[, options])

Scan a File pointer (fp) with ClamAV. If attachements are scanned separately, change the rfc822 options to false.

Params

  • fp File - the mail file
  • options array - options array

The following options are available in the options array.

  • rfc822 boolean - Scan the content as a "rfc822" message (do not rely on auto-detection). The default is true.
  • timeout number - Timeout in seconds. The default is 5 seconds.
  • path string - Path to a the clamd unix socket. The default is /var/run/clamav/clamd.ctl
  • address string - Host of the clamd server.
  • port number - Port of the clamd server.

Returns

An associative array, with a virus property containing a list of viruses found (array of strings), however note that clamd may currently only return one virus. If an error occures an error property (string) is set contaning the error message.

Example

import { clamav } from "extras://clamav";

$clamav = clamav($mail->toFile());
if ($clamav["virus"])
  Reject("Virus found");

About

ClamAV anti-virus client

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors