Follow the instructions in our manual to add our package repository and then run the below command.
apt-get install halon-extras-spamassassin
yum install halon-extras-spamassassin
These functions needs to be imported from the extras://spamassassin
module path.
Client for the SpamAssassin (spamd) Network Protocol.
Params
- fp
File
- the mail file - options
array
- options array
Returns: class object.
The following options are available in the opts array.
- path
string
- Path to a the spamd unix socket. - address
string
- Address of the spamd server. The default is127.0.0.1
- port
number
- TCP port. The default is783
. - user
string
- Username of the user for which the scan is being performed. - sender
string
- Prepends a "Return-Path" header to the mail file with the provided envelope sender. - size_limit
number
- Size limit in bytes. The default is 512 000. - timeout
number
- Timeout in seconds. The default is 30 seconds. - tls
array
- TLS settings. - report
boolean
- Return symbols including scores per symbol. The default is false - symbols_unparsed
boolean
- Return the response body unparsed as one symbol in the response. The default is false
The following options are available in the tls array.
- enabled
boolean
- Enable TLS for the specific socket - opts
array
- All available options can be found on here
If the request was successful, an associative array with the following properties (below) are returned. If an error occures an error
property (string) is set containing the error message.
spam
(boolean) if the message is spamscore
(number) representing the spam scorethreshold
(number) representing the spam limitsymbols
(array) property contaning all matched symbols as an array of strings, or in case ofreport
is true all matched symbols with their corresponding scores, or in case ofsymbols_unparsed
is true the response body is returned as a single symbol (unparsed).