SOURCES: roundcubemail-spam.patch (NEW) - patch from 'http://round...

paszczus paszczus at pld-linux.org
Sun Mar 30 15:14:42 CEST 2008


Author: paszczus                     Date: Sun Mar 30 13:14:42 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- patch from 'http://roundcubeforum.net/forum/index.php?topic=2659.0'

---- Files affected:
SOURCES:
   roundcubemail-spam.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/roundcubemail-spam.patch
diff -u /dev/null SOURCES/roundcubemail-spam.patch:1.1
--- /dev/null	Sun Mar 30 15:14:42 2008
+++ SOURCES/roundcubemail-spam.patch	Sun Mar 30 15:14:37 2008
@@ -0,0 +1,159 @@
+diff -ur roundcubemail-0.1-r1223-20080330/config/main.inc.php.dist roundcubemail-0.1-r1223-20080330.new/config/main.inc.php.dist
+--- roundcubemail-0.1-r1223-20080330/config/main.inc.php.dist	2008-03-30 13:26:34.000000000 +0200
++++ roundcubemail-0.1-r1223-20080330.new/config/main.inc.php.dist	2008-03-30 14:32:46.762822531 +0200
+@@ -250,6 +250,9 @@
+ // ONLY ENABLE IT IF YOU'RE REALLY SURE WHAT YOU'RE DOING!
+ $rcmail_config['enable_installer'] = false;
+ 
++// keyword for subject filtering and move to Junk box
++$rcmail_config['spam_subject'] = '/^\*\*\*SPAM\*\*\*/';
++
+ 
+ /***** these settings can be overwritten by user's preferences *****/
+ 
+diff -ur roundcubemail-0.1-r1223-20080330/program/localization/en_GB/messages.inc roundcubemail-0.1-r1223-20080330.new/program/localization/en_GB/messages.inc
+--- roundcubemail-0.1-r1223-20080330/program/localization/en_GB/messages.inc	2008-03-30 13:26:45.000000000 +0200
++++ roundcubemail-0.1-r1223-20080330.new/program/localization/en_GB/messages.inc	2008-03-30 14:56:30.368416277 +0200
+@@ -72,6 +72,7 @@
+ $messages['copysuccess'] = 'Successfully copied $nr addresses';
+ $messages['copyerror'] = 'Could not copy any addresses';
+ $messages['sourceisreadonly'] = 'This address source is read-only';
++$messages['spammessagesfound'] = '$nr of your spam message(s) was moved to <strong>$mbox</strong>';
+ $messages['errorsavingcontact'] = 'Could not save the contact address';
+ $messages['movingmessage'] = 'Moving message...';
+ $messages['receiptsent'] = 'Successfully sent a read receipt';
+@@ -79,4 +80,4 @@
+ $messages['nodeletelastidentity'] = 'You cannot delete this identity, it\'s your last one.';
+ $messages['addsubfolderhint'] = 'This folder will be created as subfolder of the currently selected one';
+ 
+-?>
+\ Brak znaku nowej linii na końcu pliku
++?>
+diff -ur roundcubemail-0.1-r1223-20080330/program/localization/en_US/messages.inc roundcubemail-0.1-r1223-20080330.new/program/localization/en_US/messages.inc
+--- roundcubemail-0.1-r1223-20080330/program/localization/en_US/messages.inc	2008-03-30 13:26:47.000000000 +0200
++++ roundcubemail-0.1-r1223-20080330.new/program/localization/en_US/messages.inc	2008-03-30 14:56:42.484361755 +0200
+@@ -72,6 +72,7 @@
+ $messages['copysuccess'] = 'Successfully copied $nr addresses';
+ $messages['copyerror'] = 'Could not copy any addresses';
+ $messages['sourceisreadonly'] = 'This address source is read only';
++$messages['spammessagesfound'] = '$nr of your spam message(s) was moved to <strong>$mbox</strong>';
+ $messages['errorsavingcontact'] = 'Could not save the contact address';
+ $messages['movingmessage'] = 'Moving message...';
+ $messages['receiptsent'] = 'Successfully sent a read receipt';
+@@ -79,4 +80,4 @@
+ $messages['nodeletelastidentity'] = 'You cannot delete this identity, it\'s your last one.';
+ $messages['addsubfolderhint'] = 'This folder will be created as subfolder of the currently selected one';
+ 
+-?>
+\ Brak znaku nowej linii na końcu pliku
++?>
+diff -ur roundcubemail-0.1-r1223-20080330/program/localization/pl/messages.inc roundcubemail-0.1-r1223-20080330.new/program/localization/pl/messages.inc
+--- roundcubemail-0.1-r1223-20080330/program/localization/pl/messages.inc	2008-03-30 13:26:45.000000000 +0200
++++ roundcubemail-0.1-r1223-20080330.new/program/localization/pl/messages.inc	2008-03-30 14:57:20.752189549 +0200
+@@ -76,6 +76,7 @@
+ $messages['copysuccess'] = 'Pomyślnie skopiowano następującą liczbę adresów: $nr';
+ $messages['copyerror'] = 'Nie można skopiować żadnego adresu';
+ $messages['sourceisreadonly'] = 'Źródło adresu jest tylko do odczytu';
++$messages['spammessagesfound'] = '$nr wiadomości zostało przeniesionych do katalogu <strong>$mbox</strong>';
+ $messages['errorsavingcontact'] = 'Nie można było zapisać adresu kontaktu';
+ $messages['movingmessage'] = 'Przenoszenie wiadomości...';
+ $messages['receiptsent'] = 'Pomyślnie wysłano potwierdzenie dostarczenia';
+@@ -83,4 +84,4 @@
+ $messages['nodeletelastidentity'] = 'Nie można skasować tej tożsamości, ponieważ jest ostatnią.';
+ $messages['addsubfolderhint'] = 'Ten folder zostanie utworzony jako podfolder aktualnie wybranego.';
+ 
+-?>
+\ Brak znaku nowej linii na końcu pliku
++?>
+diff -ur roundcubemail-0.1-r1223-20080330/program/steps/mail/func.inc roundcubemail-0.1-r1223-20080330.new/program/steps/mail/func.inc
+--- roundcubemail-0.1-r1223-20080330/program/steps/mail/func.inc	2008-03-30 13:26:52.000000000 +0200
++++ roundcubemail-0.1-r1223-20080330.new/program/steps/mail/func.inc	2008-03-30 15:00:01.859464563 +0200
+@@ -197,9 +197,30 @@
+ 
+   $a_js_message_arr = array();
+ 
++// START MODIFICATION BY midnightz at hotmail.com - SPAM FIX
++  $n_of_spam = 0;
++// END MODIFICATION BY midnightz at hotmail.com - SPAM FIX
++
+   // create row for each message
+   foreach ($a_headers as $i => $header)  //while (list($i, $header) = each($a_headers))
+     {
++
++// START MODIFICATION BY midnightz at hotmail.com - SPAM FIX
++    $cont = Q(rcube_imap::decode_mime_string($header->subject, $header->charset));
++       
++    // Check to see if this subject contains our spam line and is not in the
++    // designated junk mailbox
++         
++    if ( ( $mbox!=$CONFIG['trash_mbox'] ) && ( $mbox!=$CONFIG['junk_mbox'] ) ){
++      if ( preg_match($CONFIG['spam_subject'], $cont) ){
++        $n_of_spam += 1;
++        // Move the message from this mailbox to the junk mail box
++        $IMAP->move_message( array($header->uid), $CONFIG['junk_mbox'], $mbox );
++        continue;
++      }
++    }
++// END MODIFICATION BY midnightz at hotmail.com - SPAM FIX
++
+     $message_icon = $attach_icon = '';
+     $js_row_arr = array();
+     $zebra_class = $i%2 ? 'even' : 'odd';
+@@ -293,6 +314,13 @@
+   $OUTPUT->set_env('coltypes', $a_show_cols);
+   
+   $OUTPUT->include_script('list.js');
++
++// START MODIFICATION BY midnightz at hotmail.com - SPAM FIX
++  if ( $n_of_spam ) {
++    $OUTPUT->command('set_unread_count', $CONFIG['junk_mbox'], $IMAP->messagecount($CONFIG['junk_mbox'], 'UNSEEN'));
++    $OUTPUT->show_message('spammessagesfound', 'warning', array('nr' => $n_of_spam, 'mbox' => rcube_label("junk")));
++  }
++// END MODIFICATION BY midnightz at hotmail.com - SPAM FIX
+   
+   return $out;
+   }
+@@ -313,6 +341,10 @@
+ 
+   $OUTPUT->command('set_message_coltypes', $a_show_cols);
+ 
++// START MODIFICATION BY midnightz at hotmail.com - SPAM FIX
++  $n_of_spam = 0;
++// END MODIFICATION BY midnightz at hotmail.com - SPAM FIX
++
+   // loop through message headers
+   foreach ($a_headers as $n => $header)
+     {
+@@ -322,6 +354,17 @@
+     if (empty($header))
+       continue;
+ 
++// START MODIFICATION BY midnightz at hotmail.com - SPAM FIX
++    $cont = Q(rcube_imap::decode_mime_string($header->subject, $header->charset));
++    if ( ( $mbox!=$CONFIG['trash_mbox'] ) && ( $mbox!=$CONFIG['junk_mbox'] ) ){
++      if ( preg_match($CONFIG['spam_subject'],$cont) ){
++        $n_of_spam += 1;
++        $IMAP->move_message( array($header->uid), $CONFIG['junk_mbox'], $mbox );
++        continue;
++      }
++    }
++// END MODIFICATION BY midnightz at hotmail.com - SPAM FIX
++
+     // format each col; similar as in rcmail_message_list()
+     foreach ($a_show_cols as $col)
+       {
+@@ -355,6 +398,14 @@
+       preg_match("/multipart\/m/i", $header->ctype),
+       $insert_top);
+     }
++
++// START MODIFICATION BY midnightz at hotmail.com - SPAM FIX
++    if ( $n_of_spam ) {
++      $OUTPUT->command('set_unread_count', $CONFIG['junk_mbox'], $IMAP->messagecount($CONFIG['junk_mbox'], 'UNSEEN'));
++      $OUTPUT->show_message('spammessagesfound', 'warning', array('nr' => $n_of_spam, 'mbox' => rcube_label("junk")));
++    }
++// END MODIFICATION BY midnightz at hotmail.com - SPAM FIX
++
+   }
+ 
+ 
================================================================


More information about the pld-cvs-commit mailing list