Why not adopt me?
NAME
Mail::SpamAssassin::SimpleClient - easy client to SpamAssassin's spamd
VERSION
version 0.004
$Id: /my/pep/Mail-SpamAssassin-SimpleClient/trunk/lib/Mail/SpamAssassin/SimpleClient.pm 31400 2007-04-12T23:45:52.621875Z rjbs $
SYNOPSIS
my $spamc = Mail::SpamAssassin::Simpleclient->new;
die "It's horrible, horrible spam!" if $spamc->check($message)->is_spam;
WARNING
Achtung!
This module is still in its infancy. Its interface will probably change somewhat, especially if some changes are made to the spamd protocol to make this module awesomer. Please don't rely on it. Just play with it and try to help figure out how to make it great.
DESCRIPTION
Mail::SpamAssassin is a great, free tool for identifying spam messages. It is generally accessed via the spamc or spamassassin programs. Despite the fact that SpamAssassin in implemented in Perl, it is often difficult to check a message against SpamAssassin from within a Perl program.
This module provides a very simple (but also limited) interface to check mail against SpamAssassin.
METHODS
new
my $client = Mail::SpamAssassin::SimpleClient->new(\%arg);
This method returns a new SimpleClient object.
Valid arguments are:
host - the host on which to look for spamd (default: localhost)
port - the port on which to look for spamd (default: 783)
username - username to pass to spamd
timeout - how long (in seconds) to allow SpamAssassin to consider the
message before an exception is raised; default 120; set to 0 to
wait forever
check
my $result = $spamc->check($message);
This method passes a message to SpamAssassin to be spam-checked. It returns a Mail::SpamAssassin::SimpleClient::Result object. If SpamAssassin does not respond within the SimpleClient's timeout period, an exception is raised.
TODO
Support spamd-less operation.
Get the protocol to support "always rewrite" or another way to always get scores.
AUTHOR
Ricardo SIGNES, <rjbs@cpan.org>
BUGS
Please report any bugs or feature requests through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
COPYRIGHT
Copyright 2007 Ricardo SIGNES, all rights reserved.
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.