NAME

Mail::Abuse::ProcessorTableDBI - Match incidents to other data using a DBI table

SYNOPSIS

use Mail::Abuse::ProcessorTableDBI;

use Mail::Abuse::Report;
my $p = new Mail::Abuse::ProcessorTableDBI;
my $report = new Mail::Abuse::Report (processors => [ $p ]);

# ... other pieces of code that configure the report ...

DESCRIPTION

This class matches incidents to data gathered into a DBI table. The most recent entry in the DBI table will be used as the result.

debug dbi table

If set to a true value, causes this module to emit debugging info using warn().

dbi table dsn

Specifies the DSN used to connect to the DBI database holding the table we will be using.

dbi table user

The username used to connect to the DSN. If specified in the DSN itself, can be left blank.

dbi table pass

The password used to connect to the DSN. If specified in the DSN, it can be left blank. Note that this is not good, as the DSN will be printed along DBI-related error messages.

dbi table name

The name of the table to query. This table must define the following columns.

CIDR_Start

The beginning of the CIDR range for which the remaining columns apply. This is supposed to be the network IP address, as an unsigned int.

CIDR_End

The end of the CIDR range for which the remaining columns apply. This is supposed to be the broadcast IP address, as an unsigned int.

TIME_Start

The number of seconds since the epoch for the start of the time window in which this entry is valid.

TIME_End

The number of seconds since the epoch for the end of the time window in which this entry is valid. If this value is NULL, the entry is assumed to be valid forever.

The rest of the columns will be included in the resulting information stored into the incident. For instance, a column named "Foo" will cause the following structure to be added to the incident

{ Foo => column contents }

This is similar to the way in which Mail::Abuse::Processor::Table works.

The following functions are implemented.

process($report)

Takes a Mail::Abuse::Report object as an argument and, for each Mail::Abuse::Incident collected, perform a lookup in the given table, attempting to match it by IP address and timestamp.

If a match is found, all the columns found in the DBI query, are added to the incident.

EXPORT

None by default.

HISTORY

$Log: TableDBI.pm,v $
Revision 1.3  2006/09/21 16:18:37  lem
Indented the CHANGES section so that the POD processing does what I
want.

Revision 1.2  2006/09/21 16:17:43  lem
Entries with a NULL end time should be valid "forever". This allows
for the easy inclussion of fixed network elements in the table (ie,
the basic network assignment).

The entry with the most recent time will be used as the result.

Revision 1.1  2005/06/09 16:03:46  lem
First version, ready for beta testing

LICENSE AND WARRANTY

This code and all accompanying software comes with NO WARRANTY. You use it at your own risk.

This code and all accompanying software can be used freely under the same terms as Perl itself.

AUTHOR

Luis E. Muñoz <luismunoz@cpan.org>

SEE ALSO

Mail::Abuse::Processor::Table(3), perl(1).

1 POD Error

The following errors were encountered while parsing the POD:

Around line 303:

Non-ASCII character seen before =encoding in 'Muñoz'. Assuming CP1252