This could be useful to OpenGuides.
-----Original Message----- From: Simon Cozens [mailto:simon@simon-cozens.org] Sent: 23 March 2006 23:28 To: london.pm Subject: [upload@pause.perl.org: CPAN Upload:S/SI/SIMON/SpamMonkey-0.02.tar.gz]
Since you asked so nicely. Doesn't include the Email::Received stuff, (and therefore RBL checking) of course; look for that coming when it finally passes SpamAssassin's tests.
It's still useful; here's a generic spam-trapped comment feature for Maypole:
use SpamMonkey; my $sm = SpamMonkey->new; $sm->ready();
sub add_comment :Exported { my ($self, $r, $thing) = @_; my $res = $sm->test($r->params->{content}); if ($res->is_spam) { return $self->error("I think you're a spammer, because your comment: ". join("\n", $res->describe_hits)); } $thing->add_to_comments({ author=> $r->params->{author}, url => $r->params->{url}, content => $r->params->{content}, posted => Time::Piece->new, }); $r->template("view"); }
Simon
----- Forwarded message from PAUSE upload@pause.perl.org -----
From: PAUSE upload@pause.perl.org Subject: CPAN Upload: S/SI/SIMON/SpamMonkey-0.02.tar.gz To: Simon Cozens simon@simon-cozens.org Reply-To: cpan-testers@perl.org
The uploaded file
SpamMonkey-0.02.tar.gz
has entered CPAN as
file: $CPAN/authors/id/S/SI/SIMON/SpamMonkey-0.02.tar.gz size: 6858 bytes md5: 2994361baa44bbadd50248d83471542a
No action is required on your part Request entered by: SIMON (Simon Cozens) Request entered on: Thu, 23 Mar 2006 23:22:54 GMT Request completed: Thu, 23 Mar 2006 23:24:15 GMT
Thanks,
openguides-dev@lists.openguides.org