You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by "jyothi B.S." <jy...@yahoo.co.in> on 2007/12/03 11:40:28 UTC
Help needed
hi
I am trying to use SpamAssassin. When I tried to write my plugin 'MyPluginX' by deriving from Mail::SpamAssassin::Plugin, I get an error message and programs dies.
More details:
------------
In the documentation, its given that we need to provide $mailsaobject
"Note that subclasses must provide the "$mailsaobject" to the super-
class constructor, like so:
my $self = $class->SUPER::new($mailsaobject); "
In the base class "Mail::SpamAssassin::Plugin", new() is invoked within which a check is made to ensure that $mailsaobject is defined.
Code in MyPluginX:
-----------------
package MyPluginX;
use strict;
use Mail::SpamAssassin::Plugin;
our @ISA = qw(Mail::SpamAssassin::Plugin);
sub new
{
my ($class, $mailsa) = @_;
$class = ref($class) || $class;
my $self = $class->SUPER::new($mailsa);
bless ($self, $class);
....
}
Code in Mail::SpamAssassin::Plugin
----------------------------------
if (!defined $mailsaobject) {
die "plugin here: usage: Mail::SpamAssassin::Plugin::new(class,mailsaobject)";
}
My program execution stops/dies here since I dont pass this $mailsaobject. My question is how to create this object? I couldnt find any documentation regarding creating this object (a mandatory parameter!)
Any help would be greatly appreciated since I am new to SpamAssassin.
Regards
Jyothi
____________________________________________________________________________________
Be a better pen pal.
Text or chat with friends inside Yahoo! Mail. See how. http://overview.mail.yahoo.com/