Follow the instructions in our manual to add our package repository and then run the below command.
apt-get install halon-extras-eleven
yum install halon-extras-eleven
These functions needs to be imported from the extras://eleven module path.
Client for the eleven eXpurgate anti-spam.
Params
- fp
File- the mail file - options
array- options array
The following options are available in the options array.
- address
string- Address of the eXpurgate Spamd server. The default is127.0.0.1. - port
number- TCP port. The default is783. - id
string- The ID to be logged with the message (see Custom-Connection-ID) - expurgateid
string- The Expurgate ID from a previous scan to indicate a rescan (doesn't increment counters, see X-Purgate-ID) - senderip
string- The sender IP. - sender
string- The envelope sender. - recipients
array- The envelope recipients in this format. - size_limit
number- Size limit in bytes. The default is500 * 1024. - timeout
number- Timeout in seconds. The default is30seconds.
Returns
An associative array with the following properties set.
spam(boolean) if the message is spamscore(number) representing the spam scorethreshold(number) representing the spam limitcategory(string) representing the category for the messageid(string) representing a unique ID
If an error occures an error property (string) is set contaning the error message.
import { expurgate } from "extras://eleven";
$expurgate = expurgate($mail->toFile(), [
"port" => 783,
"senderip" => $connection["remoteip"],
"sender" => $transaction["sender"],
"recipients" => $transaction["recipients"],
"id" => $transaction["id"]
]);
if ($expurgate["spam"])
{
// handle as spam
}