|
NAMEMail::SpamAssassin::Pyzor::Client - Pyzor client logic SYNOPSIS use Mail::SpamAssassin::Pyzor::Client ();
use Mail::SpamAssassin::Pyzor::Digest ();
my $client = Mail::SpamAssassin::Pyzor::Client->new();
my $digest = Mail::SpamAssassin::Pyzor::Digest::get( $msg );
my $check_ref = $client->check($digest);
die $check_ref->{'Diag'} if $check_ref->{'Code'} ne '200';
my $report_ref = $client->report($digest);
die $report_ref->{'Diag'} if $report_ref->{'Code'} ne '200';
DESCRIPTIONA bare-bones Pyzor <http://pyzor.org> client that currently only implements the functionality needed for Mail::SpamAssassin. PROTOCOL DETAILSThe Pyzor protocol is not a published standard, and there appears to be no meaningful public documentation. What follows is enough information, largely gleaned through forum posts and reverse engineering, to facilitate effective use of this module: Pyzor is an RPC-oriented, message-based protocol. Each message is a simple dictionary of 7-bit ASCII keys and values. Server responses always include at least the following:
(NB: There are additional standard response headers that are useful only for the protocol itself and thus are not part of this module's returns.) ReliabilityPyzor uses UDP rather than TCP, so no message is guaranteed to reach its destination. A transmission failure can happen in either the request or the response; in either case, a timeout error will result. Such errors are represented as thrown instances of Mail::Pyzor::X::Timeout. CONSTRUCTORnew(%OPTS)Create a new pyzor client.
Returns a Mail::SpamAssassin::Pyzor::Client object.
REQUEST METHODSreport($digest)Report the digest of a spam message to the pyzor server. This function will throw if a messaging failure or timeout happens.
check($digest)Check the digest of a message to see if the pyzor server has a report for it. This function will throw if a messaging failure or timeout happens.
|