[RCD] Filter

Steven revimmo steven at revimmo.com
Wed Feb 16 14:38:44 CET 2011


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 :

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,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.roundcube.net/pipermail/dev/attachments/20110216/16598668/attachment.html>
-------------- next part --------------
List info: http://lists.roundcube.net/dev/

More information about the Dev mailing list