Author Topic: Easy SpamAssassin Filtering  (Read 37178 times)

Offline skrieg

  • Newbie
  • *
  • Posts: 5
Re: Easy SpamAssassin Filtering
« Reply #15 on: December 28, 2007, 06:00:10 AM »
Hi,

Since RC2, the func file has completely changed. I cannot use the patch anymore :(

Thanks.

Offline Jonn3

  • Jr. Member
  • **
  • Posts: 23
Re: Easy SpamAssassin Filtering
« Reply #16 on: December 28, 2007, 09:08:02 AM »
It does work. Just use Le Veilleur's file, and the optional modification below his post.

Offline skrieg

  • Newbie
  • *
  • Posts: 5
Re: Easy SpamAssassin Filtering
« Reply #17 on: December 28, 2007, 09:20:02 AM »
My bad.
Sorry
Works like a charm

Offline Jonn3

  • Jr. Member
  • **
  • Posts: 23
Re: Easy SpamAssassin Filtering
« Reply #18 on: December 29, 2007, 10:56:43 AM »
There is one or two things though.
Have any of you problems deleting mail from Junk folder. If i delete a message, then go to Trash, and then go back to Junk again, it's still there.

The other stuff is in the log.

[29-Dec-2007 13:20:35] PHP Fatal error: Call to undefined function rcmail_deliver_message() in /home/httpd/html/roundcube/program/steps/mail/sendmail.inc on line 306

&

[28-Dec-2007 14:45:05] PHP Fatal error: Cannot redeclare rcmail_mailbox_list() (previously declared in /home/httpd/html/roundcube/program/include/main.inc:1595) in /home/httpd/html/roundcube/program/steps/mail/func.inc on line 144

Hopefully we can get a new file which is up to date...

Offline Jonn3

  • Jr. Member
  • **
  • Posts: 23
Re: Easy SpamAssassin Filtering
« Reply #19 on: December 29, 2007, 08:16:56 PM »
Ok, with the old func.inc file, you can't send mail. We need an update for this asap.
Please check if you can send mail, and report back.

Offline sphinx4

  • Newbie
  • *
  • Posts: 1
Easy SpamAssassin Filtering
« Reply #20 on: February 18, 2009, 05:18:37 AM »
The last post is old, i know, but if also someone is wondering, why deleted junkmails never could be deletet, just add this code

if ( $mbox=='INBOX' ) {
if ( ( preg_match($CONFIG['spam_subject'],$cont) ) && ( $mbox != $CONFIG['junk_mbox'] ) ) {
$is_spam = 1;
}
}

to the patch.

Hope this helps someone.

Offline Giulio

  • Newbie
  • *
  • Posts: 2
Easy SpamAssassin Filtering
« Reply #21 on: February 18, 2009, 11:33:50 AM »
Is this patch works with 0.2 stable?

Offline loop

  • Newbie
  • *
  • Posts: 1
Easy SpamAssassin Filtering
« Reply #22 on: February 24, 2009, 06:31:06 AM »
Hello
In 0.2 stable I manually put lines like this into func.inc:
// START MODIFICATION (1 of 4)  BY steve@fusionreactions.com - SPAM FIX
[...]
// END MODIFICATION
Because when I replace func.inc Roundcube don't work. If someone want's I can do a patch file


But problem was in main.inc:
$rcmail_config['spam_subject'] = '***SPAM***';

I don't know how describe tag which puts Spamassassin. Listed above doesn't work.

Works:
$rcmail_config['spam_subject'] = 'SPAM';

But how to do something like this /^\*\*\*SPAM\*\*\*/ in that var?

Regards, Peter

Offline fkw

  • Newbie
  • *
  • Posts: 1
Easy SpamAssassin Filtering
« Reply #23 on: March 07, 2009, 02:17:00 PM »
Quote from: loop;17266
I don't know how describe tag which puts Spamassassin. Listed above doesn't work.

Works:
$rcmail_config['spam_subject'] = 'SPAM';

But how to do something like this /^\*\*\*SPAM\*\*\*/ in that var?

Regards, Peter


Hello,

try something like this for ***SAPM***:
$rcmail_config['spam_subject'] = '/^\*\*\*SPAM\*\*\*/';

or you can also change the comment from SpamAssassin about your setting for the mailbox.

Regards, fkw

Offline zamri

  • Jr. Member
  • **
  • Posts: 16
Easy SpamAssassin Filtering
« Reply #24 on: March 07, 2009, 11:29:15 PM »
Does anyone prepare for 0.2stable patch of this plugin?

Offline mark_valley

  • Newbie
  • *
  • Posts: 8
Problems with unread messages counter
« Reply #25 on: March 10, 2009, 03:30:27 PM »
Hello everyone. It seems there isn't no comments in this topic for a long time... :confused:

I work in a brazilian university and recently we adopted Roundcube 0.2 as our webmail client.  Well, spams are a huge problem here and we have lots of users complaining about some kind of spam filtering.

To resolve this e adapted the code presented in this topic and I could get the messages tagged by spamassassin moved to the junk folder.

The problem is that the Inbox unread counter isnĀ“t updated until i click it for the second time and my users continue complaining... :mad:

In my code (inside rcmail_js_message_list function), it seems that the following line used to update INBOX doesn't work at all:

$OUTPUT->command('set_unread_count', 'INBOX', $IMAP->messagecount('INBOX', 'UNSEEN'));


I am a bit confused because after that line i added the following one to actualize the junk_box unread message counter and it worked pretty well:

$OUTPUT->command('set_unread_count', $CONFIG['junk_mbox'],         $IMAP->messagecount($CONFIG['junk_mbox'], 'UNSEEN'));


Can anyone help me?

PS.: If a solution was developed since 2007 I would be very glad to know.
« Last Edit: March 10, 2009, 03:55:11 PM by mark_valley »

Offline woOtzee

  • Newbie
  • *
  • Posts: 2
Easy SpamAssassin Filtering
« Reply #26 on: April 03, 2009, 09:38:31 AM »
It's sad this fix doesn't work anymore.

Will there any in the future ?
Spam is a big problem for me, i'm searching for a solution.

Offline woOtzee

  • Newbie
  • *
  • Posts: 2
Easy SpamAssassin Filtering
« Reply #27 on: April 04, 2009, 01:21:27 PM »
Ok.

I found a script by midnightz  ( http://www.roundcubeforum.net/plug-ins/2565-replacement-easy-spamassassin-filtering.html )

I just made it more simple :


You just have to edit ./program/steps/mail/func.inc, ~line 245

After :

  // create row for each message
  foreach ($a_headers as $i => $header)  //while (list($i, $header) = each($a_headers))
    {

Add :


  // ******************************************************
  // ADD by woOtzee.com SPAM FIX

   $spamfix_subject = Q(rcube_imap::decode_mime_string($header->subject, $header->charset));
   if ($mbox!=$CONFIG['trash_mbox'] && $mbox!=$CONFIG['junk_mbox']) {
     if (preg_match("'^\[SPAM\]'",$spamfix_subject) && !$header->seen) {
        $IMAP->move_message( array($header->uid), $CONFIG['junk_mbox'], $mbox );
        continue;
     }
   }

  // ADD by woOtzee.com SPAM FIX
  // ******************************************************


All unread mail marked as spam will be redirect to your junk box.
If you se a mail witch isn't spam in junk box, just mark it as read, and put it again
in the inbox box.

But, you need to clic on the mail icon on the top of the page to make it works.

If your spam tag isn't [SPAM] but, ***SPAM*** for exemple, like in the begin of
this post, just replace :
^\[SPAM\]
by :
/^\*\*\*SPAM\*\*\*/


Hope there's no mistake, it works for me !

Offline lhwparis

  • Newbie
  • *
  • Posts: 3
Easy SpamAssassin Filtering
« Reply #28 on: April 24, 2009, 04:51:25 AM »
Hello together,
is there now any Version of this SpamAssassin Filter which works definitivly with the newest roundcube version (0.2.1) ?
I use 0.1 untill now because i need this plugin :/

Thankst for your help.

Offline dawn

  • Newbie
  • *
  • Posts: 2
Easy SpamAssassin Filtering
« Reply #29 on: April 29, 2009, 09:26:55 AM »
@woOtzee: First of all thanks a lot for your fix. But do I overlook something? I've inserted your code (in my case for "***SPAM***") at the place you told, but I don't see anything happen. Do I add other code too? Is this really working for 0.2.1 stable?

Code: [Select]
   // **************************************************
    // ADD by woOtzee.com SPAM FIX

    $spamfix_subject = Q(rcube_imap::decode_mime_string($header->subject, $header->charset));

    if ($mbox!=$CONFIG['trash_mbox'] && $mbox!=$CONFIG['junk_mbox']) {
        if (preg_match("'/^\*\*\*SPAM\*\*\*/'",$spamfix_subject) && !$header->seen) {
            $IMAP->move_message( array($header->uid), $CONFIG['junk_mbox'], $mbox );
            continue;
        }
    }

    // ADD by woOtzee.com SPAM FIX
    // **************************************************

Best regards,
Dawn