Follow the instructions in our manual to add our package repository and then run the below command.
apt-get install halon-extras-sophos
yum install halon-extras-sophos
These functions needs to be imported from the extras://sophos module path.
Scan a File pointer (fp) with the Sophos anti-virus. 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 savdid unix socket. The default is/var/run/sssp.sock - address
string- Address of the savdid server. - port
number- TCP port of the savdid server.
Returns
An associative array, with a virus property containing a list of viruses found (array of strings). If an error occures an error property (string) is set contaning the error message.
Example
import { sophos_av } from "extras://sophos";
$sophos = sophos_av($mail->toFile());
if ($sophos["virus"])
Reject("Virus found");
Scan a File pointer (fp) with the Sophos anti-spam.
Params
- fp
File- the mail file - options
array- options array
The following options are available in the options array.
- timeout
number- Timeout in seconds. The default is 5 seconds. - address
string- Address of the sasi daemon (lased) server. - port
number- TCP port of the sasi daemon (lased) server.
Returns
An associative array with all X-LASED- headers included (without the prefix). Spam determination should use the Spam array value (Confirmed or NonSpam). If an error occures an error property (string) is set contaning the error message.
Example
import { sophos_as } from "extras://sophos";
$sophos = sophos_as($mail->toFile());
if ($sophos["Spam"] == "Confirmed")
Reject("Spam");