LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Writing Spamassassin plugin. (https://www.linuxquestions.org/questions/programming-9/writing-spamassassin-plugin-814789/)

evoc 06-17-2010 02:45 PM

Writing Spamassassin plugin.
 
Hi all. I'm writing a simple spamassassin plugin that eval just subject but it does not.

I place "new" function:

Code:

sub new {
        my ($class, $mailsa) = @_;
 
    # the usual perlobj boilerplate to create a subclass object
    $class = ref($class) || $class;
    my $self = $class->SUPER::new($mailsa);
    bless ($self, $class);
 

    # add header's token control
    $self->register_eval_rule ("check_header_token");
   
    # and return the new plugin object
    return $self;                               
}

Than i defined the function:
Code:

sub check_header_token
{
       
        my ($self, $pms) = @_;
       
        $subject = $pms->get('Subject');
       
        if($subject == 'HELLO')
        {
#bad message
                return 0;
        }
       
        return 1;
}

What i miss? I put log message on new and on rule and i saw that it did the new function but if i telnet a mail message with "HELLO" as a subject it write it into mailbox.

Can you help me?

spampig 06-18-2010 01:08 AM

Best option - sign up to the Spamassassin users mailing list (details here): http://wiki.apache.org/spamassassin/MailingLists There you will be in touch with SA experts who should be able to help you.


All times are GMT -5. The time now is 11:06 PM.