NAME
Mail::SpamAssassin::PersistentAddrList - persistent address list base class
SYNOPSIS
my $factory = PersistentAddrListSubclass->new();
$spamtest->set_persistent_addr_list_factory ($factory);
... call into SpamAssassin classes...
SpamAssassin will call:
my $addrlist = $factory->new_checker($spamtest);
$entry = $addrlist->get_addr_entry ($addr);
...
DESCRIPTION
All persistent address list implementations, used by the auto-whitelist code to track known-good email addresses, use this as a base class.
METHODS
- $factory = PersistentAddrListSubclass->new();
-
This creates a factory object, which SpamAssassin will call to create a new checker object for the persistent address list.
- my $addrlist = $factory->new_checker();
-
Create a new address-list checker object from the factory. Called by the SpamAssassin classes.
- $entry = $addrlist->get_addr_entry ($addr);
-
Given an email address
$addr
, return an entry object with the details of that address.The entry object is a reference to a hash, which must contain at least one key:
count
, which is the count of times that address has been encountered before. Anything over 3 means the address is whitelisted.The hash can contain whatever other data your back-end needs to store, under other keys.
The method should never return
undef
, or a hash that does not contain acount
key. - $entry = $addrlist->increment_accumulator_for_entry ($entry);
-
If an address is either not found in the whitelist database, or is in the accumulator database but has not yet reached the threshold to enter the whitelist, this method will be called. It should increment the counter for that address in the accumulator database, creating the database entry if it doesn't already exist.
- $entry = $addrlist->add_permanent_entry ($entry);
-
If an address is currently in the accumulator database, but has reached the threshold to enter the whitelist database, this method will be called.
It should add the address from the entry to the whitelist database (possibly removing it from the accumulator if possible and necessary).
- $entry = $addrlist->remove_entry ($entry);
-
This method should remove the given entry from the whitelist database, both from the accumulator and the permanent db.
- $entry = $addrlist->finish ();
-
Clean up, if necessary. Called by SpamAssassin when it has finished checking, or adding to, the auto-whitelist database.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 24:
=over without closing =back