You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Keith Hackworth <ke...@rpemail.com> on 2004/10/26 17:51:27 UTC
Mail::SpamAssassin::Plugin
I'm tired of rewriting my custom-built EvalTest.pm tests every time a new
SA comes out, so I'm converting them to Mail::SpamAssassin::Plugin(s)
(Chris - this is the BAD_TAGS invalid html tag identifier and the E@sy
Tr@ns filters I posted about 6 months ago).
I finally got my code to work perfectly after quite a bit of trial and
error, but one problem - it's not reporting back to sa whether it's spam
or not. I'm doing a "return 1" (spam) or "return 0" (ham) at the end of
my subroutine, and it's not tripping the rule.
Am I just doing it wrong? Should I be using something like
$self->isspam=1 instead?
Once I get these 2 plugins working, I'll post them to the list for others
to use.
Thanks,
Keith
Re: Mail::SpamAssassin::Plugin
Posted by Theo Van Dinter <fe...@kluge.net>.
On Tue, Oct 26, 2004 at 11:51:27AM -0400, Keith Hackworth wrote:
> I finally got my code to work perfectly after quite a bit of trial and
> error, but one problem - it's not reporting back to sa whether it's spam
> or not. I'm doing a "return 1" (spam) or "return 0" (ham) at the end of
> my subroutine, and it's not tripping the rule.
Without seeing the code, there's no way to know what you're talking about. ;)
> Am I just doing it wrong? Should I be using something like
> $self->isspam=1 instead?
No, the plugin should create an EvalTest, and then the EvalTest code is
exactly the same (pretty much) as the non-plugin version. return 0/1 is the
right thing.
There are two plugins you can look at, Test which is just a generic EvalTest
sample, and MSExec (URL below) which is a MICROSOFT_EXECUTABLE replacement I
made for 3.1.
http://svn.apache.org/repos/asf/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/MSExec.pm
--
Randomly Generated Tagline:
I want to see people using Perl to glue things together creatively, not
just technically but also socially.
-- Larry Wall in <19...@wall.org>