Mail::Abuse::ProcessorTableDBI - Match incidents to other data using a DBI table
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 ...
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.
If set to a true value, causes this module to emit debugging info using warn().
warn()
Specifies the DSN used to connect to the DBI database holding the table we will be using.
The username used to connect to the DSN. If specified in the DSN itself, can be left blank.
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.
The name of the table to query. This table must define the following columns.
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.
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.
The number of seconds since the epoch for the start of the time window in which this entry is valid.
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.
NULL
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.
Mail::Abuse::Report
Mail::Abuse::Incident
If a match is found, all the columns found in the DBI query, are added to the incident.
None by default.
$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
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.
Luis E. Muñoz <luismunoz@cpan.org>
Mail::Abuse::Processor::Table(3), perl(1).
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Muñoz'. Assuming CP1252
To install Mail::Abuse, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mail::Abuse
CPAN shell
perl -MCPAN -e shell install Mail::Abuse
For more information on module installation, please visit the detailed CPAN module installation guide.