Skip to content

Latest commit

 

History

History
57 lines (38 loc) · 2.32 KB

README.md

File metadata and controls

57 lines (38 loc) · 2.32 KB

SpamAssassin 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-spamassassin

RHEL

yum install halon-extras-spamassassin

Exported functions

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

spamc(fp[, options])

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 is 127.0.0.1
  • port number - TCP port. The default is 783.
  • 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 spam
  • score (number) representing the spam score
  • threshold (number) representing the spam limit
  • symbols (array) property contaning all matched symbols as an array of strings, or in case of report is true all matched symbols with their corresponding scores, or in case of symbols_unparsed is true the response body is returned as a single symbol (unparsed).