Re: Writing Spamassassin plugin.

2010-06-18 Thread Martin Gregorie
To the OP: here are a couple of, hopefully, useful ideas: 1) If all your new plug-in is intended to do is fish a set of patterns out of the database and run them against the subject line, you may want to look at my 'portmanteau' script, which will probably run faster since the patterns don't need

Re: Writing Spamassassin plugin.

2010-06-18 Thread Karsten Bräckelmann
On Fri, 2010-06-18 at 17:47 +0200, Massimiliano Giovine wrote: > Well. That sounds more clear. > > Now, where is mysite config dir for the custom cf file? I have to > specify one to my spamassassin installation? man spamassassin Your site config dir (since you're on Ubuntu) is /etc/spamassassin,

Re: Writing Spamassassin plugin.

2010-06-18 Thread Massimiliano Giovine
Well. That sounds more clear. Now, where is mysite config dir for the custom cf file? I have to specify one to my spamassassin installation? Can i assign to my rule a so high score to don let the message delivery? > OK then. However, is the custom header analysis going to be that > complex, that

Re: Writing Spamassassin plugin.

2010-06-18 Thread Karsten Bräckelmann
On Fri, 2010-06-18 at 16:38 +0200, Massimiliano Giovine wrote: > Thanks for the answer: > I also put 25_myplugin.cf where other plugin's confs are. Don't. This will be lost on the next successful sa-update run. Instead, use your site config dir for the custom cf file. > if loadplugin myplugin > h

Re: Writing Spamassassin plugin.

2010-06-18 Thread Massimiliano Giovine
I read also the first part of that slides with the attached notes. I did exacly the same steps except the configuration parsing (i thought i don't need it, was i wrong?) I logged 2 messages 1 in the new funcion and one in eval rule function: It prints all mesages at spamd restart but not when i s

Re: Writing Spamassassin plugin.

2010-06-18 Thread Michael Parker
These might be starting to get dated a little but I think that if you look at the "Extending Apache SpamAssassin Using Plugin" slides and notes from here: http://people.apache.org/~parker/presentations/index.html That will give you a good idea on what you need to accomplish for your plugin. Mic

Re: Writing Spamassassin plugin.

2010-06-18 Thread Massimiliano Giovine
Thanks for the answer: I also put 25_myplugin.cf where other plugin's confs are. I wrote on it: if loadplugin myplugin header MY_RULE eval:check_header_token() endif but it does not change spamassassin behaviour. My plugin will be more complex and will do analysis of mail customized headers. I'm

Re: Writing Spamassassin plugin.

2010-06-18 Thread Karsten Bräckelmann
On Fri, 2010-06-18 at 09:38 +0200, Massimiliano Giovine wrote: > Hi all. I'm writing a simple spamassassin plugin that eval just > subject but it does not. > $self->register_eval_rule ("check_header_token"); It's an eval() rule. So you also need to define a SA rule, that calls the function. P

Writing Spamassassin plugin.

2010-06-18 Thread Massimiliano Giovine
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::n