Hi,
I'm writing a little filter extension to get spam out of the way.
My MTA writes ***SPAM*** in the subject line if this is the case.
As far as I can see I followed the rules for plugins, activated it, but : no go.
This is the code :
<?php
class incoming_filter extends rcube_plugin
{
public $task = 'mail';
function init()
{
$this->add_hook('message_load', array($this,'header'));
}
function header($args)
{
$text = trim($args->headers['subject']);
$pos = stristr($text, "SPAM");
if($pos == 0)
return $args;
$rcmail = rcmail::get_instance();
if (($junk_mbox = $rcmail->config->get('junk_mbox')) && $mbox != $junk_mbox) {
$rcmail->output->command('move_messages', $junk_mbox);
}
}
}
?>
Can anybody point me in the direction what i'm doing wrong ???
Thanks in advance,
Steven