Bogofilter — An interface to the bogofilter spamfilter
Bogofilter is part of the SpamFilter package.
class Bogofilter { public bool $add_bogosity_header public bool $auto_register public string $bin public string $database_path private string $error public float $ham_cutoff public float $min_dev public float $ns_esf public bool $parse_headers public float $robs public float $robx public float $spam_cutoff public float $sp_esf private string build_command ( mixed $options ); public void error ( void ); public int filter ( string $message, mixed &$score ); public float get_score ( mixed $message ); public bool register ( string $message, int $class ); private float run ( string $message, string $options ); public bool unregister ( string $message, int $class ); }
Bogofilter
An interface to the bogofilter spamfilter
public bool $add_bogosity_header
Sets the X-Bogosity header when filtering e-mails
Default value: empty string
public bool $auto_register
Register the message's text after classifying it as spam or non-spam. A spam message will be registered on the spamlist and a non-spam message on the goodlist. If the classification is "unsure", the message will not be registered. Caution is urged in the use of this capability, as any classification errors bogofilter may make will be preserved and will accumulate. Note this option cause the database to be opened for write access, which can entail massive slowdowns through lock contention and synchronous I/O operations.
Default value: empty string
public string $bin
The bogofilter command. This can contain a full path
Default value: empty string
public string $database_path
Path to a directory that holds the bogofilter database
Default value: empty string
private string $error
The output to stderr of the last bogofilter run
Default value: empty string
public float $ham_cutoff
Any text with a bogosity below this cutoff are marked as ham. Anything above is either spam or unsure
Default value: empty string
public float $min_dev
Minumum Deviation. Please refer to the bogofilter man page for more information
Default value: empty string
public float $ns_esf
Effective Size Factor values. Please refer to the bogofilter man page for more information
Default value: empty string
public bool $parse_headers
Whether the input is e-mail messages containing e-mail headers or simple text (such as blog comments)
Default value: empty string
public float $robs
Robinson Constants. Please refer to the bogofilter man page for more information
Default value: empty string
public float $robx
Robinson Constants. Please refer to the bogofilter man page for more information
Default value: empty string
public float $spam_cutoff
Any text with a bogosity above this cutoff are marked as spam. Anything below is either ham or unsure
Default value: empty string
public float $sp_esf
Effective Size Factor values. Please refer to the bogofilter man page for more information
Default value: empty string
private string build_command ( mixed $options );
Build the command to execute.
public void error ( void );
Get the errors from the last bogofilter run
public int filter ( string $message, mixed &$score );
Run a message through bogofilter
public float get_score ( mixed $message );
Get the spam score of a message
public bool register ( string $message, int $class );
Register a message as spam or ham
private float run ( string $message, string $options );
Run bogosity on the message with the extra options given
public bool unregister ( string $message, int $class );
Undo a previous registration of a message as spam or ham