Private Methods


Mail::SpamAssassin::BayesStore::PgSQL − PostgreSQL Specific Bayesian Storage Module Implementation



This module implements a PostgreSQL specific bayesian storage module.

It subclasses Mail::SpamAssassin::BayesStore::SQL and overrides any methods which makes SQL calls involving the token column. Since PostgreSQL uses BYTEA for the token column type you must make sure that the DBD driver does the proper quoting. You can accomplish this by binding the token column to a specific type.


public instance (Integer, Integer,
Integer, Integer) token_expiration(\% $opts,
Integer $newdelta,
@ @vars)

Description: This method performs the database specific expiration of tokens based on the passed in $newdelta and @vars.

public (Boolean) seen_put (string $msgid, char $flag)

Description: This method records $msgid as the type given by $flag. $flag is one of two values ’s’ for spam and ’h’ for ham.

public instance (Boolean) seen_delete (string $msgid)

Description: This method removes $msgid from the database.

public instance (Boolean) set_last_expire (Integer $time)

Description: This method sets the last expire time.

public instance (String $time) set_running_expire_tok ()

Description: This method sets the time that an expire starts running.

public instance (Boolean) remove_running_expire_tok ()

Description: This method removes the row in the database that indicates that and expire is currently running.

public instance (Integer, Integer, Integer) tok_get (String $token)

Description: This method retrieves a specificed token ($token) from the database and returns it’s spam_count, ham_count and last access time.

public instance (\@) tok_get (@ $tokens)

Description: This method retrieves the specified tokens ($tokens) from storage and returns an array ref of arrays spam count, ham acount and last access time.

public instance (Boolean) nspam_nham_change (Integer $num_spam,
Integer $num_ham)

Description: This method updates the number of spam and the number of ham in the database.

public instance (Boolean) tok_touch (String $token,
String $atime)

Description: This method updates the given tokens ($token) atime.

The assumption is that the token already exists in the database.

public instance (Boolean) tok_touch (\@ $tokens
String $atime)

Description: This method does a mass update of the given list of tokens $tokens, if the existing token atime is < $atime.

The assumption is that the tokens already exist in the database.

We should never be touching more than N_SIGNIFICANT_TOKENS, so we can make some assumptions about how to handle the data (ie no need to batch like we do in tok_get_all)

public instance (Boolean) cleanup ()

Description: This method perfoms any cleanup necessary before moving onto the next operation.

public instance (Boolean) clear_database ()

Description: This method deletes all records for a particular user.

Callers should be aware that any errors returned by this method could causes the database to be inconsistent for the given user.

Private Methods

private instance (Boolean) _connect_db ()

Description: This method connects to the SQL database.

private instance (Boolean) _put_token (string $token,
integer $spam_count,

integer $ham_count, string $atime)

Description: This method performs the work of either inserting or updating a token in the database.

private instance (Boolean) _put_tokens (\% $token,
integer $spam_count,

integer $ham_count, string $atime)

Description: This method performs the work of either inserting or updating tokens in the database.

private instance (String) _token_select_string

Description: This method returns the string to be used in SELECT statements to represent the token column.

More Linux Commands

set_field_type(3form) - data type validation for fields.....
The function set_field_type declares a data type for a given form field. This is the type checked by validation functions. The predefined types are as follows:

GDBM_File(3pm) - Perl5 access to the gdbm library. (ManPage)
GDBM_File is a module which allows Perl programs to make use of the facilities provided by the GNU gdbm library. If you intend to use this module you should rea

Tcl_ChannelBuffered(3) - procedures for creating and manipul
Tcl uses a two-layered channel architecture. It provides a generic upper layer to enable C and Tcl programs to perform input and output using the same APIs for

set_item_opts(3menu) - set and get menu item options........
The function set_item_opts sets all the given items option bits (menu option bits may be logically-ORed together). The function item_opts_on turns on the given

w(1) - Show who is logged on and what they are doing........
w displays information about the users currently on the machine, and their processes. The header shows, in this order, the current time, how long the system has

DefaultDepth(3) - Display macros and functions (Man Page)...
The AllPlanes macro returns a value with all bits set to 1 suitable for use in a plane argument to a procedure. The BlackPixel macro returns the black pixel val

glRotate(3gl) - multiply the current matrix by a rotation ma
glRotate produces a rotation of angle degrees around the vector $(x, y, z)$. The current matrix (see glMatrixMode) is multiplied by a rotation matrix with the p

gnutls_x509_crq_get_basic_constraints(3) - API function.....
gnutls_x509_crq_get_basic_constraints.3 - This function will read the certificates basic constraints, and return the certificates CA status. It reads the basicC

swapon(8) - enable/disable devices and files for paging and
swapon is used to specify devices on which paging and swapping are to take place. The device or file used is given by the specialfile parameter. It may be of th

XRRConfigCurrentRate(3) - X Resize, Rotate and Reflection ex
Xrandr is a simple library designed to interface the X Resize and Rotate Extension. This allows clients to change the size and rotation of the root window of a

File::Basename(3pm) - Parse file paths into directory, filen
These routines allow you to parse file paths into their directory, filename and suffix. NOTE : dirname() and basename() emulate the behaviours, and quirks, of t

XtTranslateKeycode(3) - convert KeySym to KeyCodes (ManPage)
The XtSetKeyTranslator function sets the specified procedure as the current key translator. The default translator is XtTranslateKey, an XtKeyProc that uses Shi

We can't live, work or learn in freedom unless the software we use is free.