NAME

Spamtrak - Operations for the Spamtrak system.


SYNOPSIS

 use Spamtrak;

constructor $spt = new Spamtrak [$hostaddr];

methods $spt->lookup($hostaddr); $spt->update($ndays);

properties $spt->host_addr; $spt->host_addr_count; $spt->host_addr_score; $spt->net_addr; $spt->net_addr_count; $spt->net_addr_score; $spt->summary;


DESCRIPTION

This manual page documents the functional interface to the Spamtrak system. This interface may be used to lookup information in the Spamtrak database and update the database with information on newly received spam.

The new Constructor

    $spt = new Spamtrak [$hostaddr];

Creates an object in the Spamtrak class. If a $hostaddr is specified, it will be looked up in the database and used to initialize the object properties. Otherwise, the properties will remain undefined until a lookup is performed.

The lookup Method

    $spt->lookup($hostaddr);

The database is queried with the indicated $hostaddr, and the resulting information is retrieved. The properties listed below are then used to examine this information.

The update Method

    $spt->update($ndays);

This indicates that a spam message was received $ndays ago from the $hostaddr associated with this object. The database values for this $hostaddr (and object properties) are updated.

Set $ndays to ``0'' to record a spam being received now. A negative value ``unreceives'' a message--it reduces the statistics for the target. Use negative zero (``-0'') to back out a message received now.

Properties

    $spt->host_addr;            # The host address (a.b.c.d)
    $spt->host_addr_count;      # Spam mssgs from this host.
    $spt->host_addr_score;      # Spam score for this host.
    $spt->net_addr;             # The network address (a.b.c)
    $spt->net_addr_count;       # Spam mssgs from this net.
    $spt->net_addr_score;       # Spam score for this net.
    $spt->summary;              # Printable summary.

These properties return information on the Spamtrak entry found in the database. The count and score values will be zero if there are no data on the corresonding host or net.

The summary property is a text string such as:

    host 64.86.155.141 count 3 score 2.90, net 64.86.155 count 30 score 18.29

Global Settings

When the Spamtrak module is loaded, the following global variables are created :

$Spamtrak::DATABASE
The path to the Spamtrak database. This is loaded from the $SPAMTRAK_DATABASE environment parameter. If not defined, then the module will abort with an error.

$Spamtrak::AGING_CONSTANT
The aging constant used to calculate the spam scores. The default value is 0.98. This may be overridden (but probably shouldn't) by an envionment parameter called $SPAMTRAK_AGING_CONSTANT.

@Spamtrak::LOCAL_ADDRS
List of local network addresses. This is loaded from the $SPAMTRAK_LOCAL_ADDRS environment parameter. If not defined, then the module will abort with an error.

The Spamtrak system uses the spamtrak-wrapper script to initialize the required environment settings. See the spamtrak(1) manual page for more information.


BUGS

None yet.


SEE ALSO

 spamtrak-dbop(1), spamtrak-mssg(1), spamtrak-query(1)
 spamtrak(1), Spamtrak_DB(3)


AUTHOR

 Chip Rosenthal
 Unicom Systems Development
 <chip@unicom.com>
 $Id: Spamtrak.pm,v 1.2 2002/07/29 03:14:21 chip Exp $