LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-17-2010, 02:45 PM   #1
evoc
LQ Newbie
 
Registered: Dec 2007
Location: La Spezia, Italy
Distribution: Ubuntu
Posts: 11

Rep: Reputation: 0
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?
 
Old 06-18-2010, 01:08 AM   #2
spampig
Member
 
Registered: Feb 2010
Location: /Earth/UK/England/Hampshire
Distribution: Debian, Ubuntu, CentOS, Slackware
Posts: 262
Blog Entries: 2

Rep: Reputation: 56
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error enabling spampd for Spamassassin plugin in Sylpheed-Claws GTK2 Thane Ubuntu 5 07-05-2007 07:00 PM
Where can I find OCR plugin for Spamassassin combilli Linux - Software 1 11-01-2006 02:24 AM
Gaim plugin writing Rajahuroman Programming 2 05-28-2006 01:31 AM
writing a freevo plugin shanenin Programming 2 12-07-2005 06:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration