Fix for updating the filters rules when a folder is renamed.
[squirrelmail.git] / plugins / filters / filters.php
index 98935f3b6861835df65f3f6565ac2554a1ce5032..be2c1a053e1a6513b6683c43961d9d2bb175f59e 100644 (file)
@@ -2,22 +2,6 @@
 /**
  * Message and Spam Filter Plugin - Filtering Functions
  *
- * This plugin filters your inbox into different folders based upon given
- * criteria.  It is most useful for people who are subscibed to mailing lists
- * to help organize their messages.  The argument stands that filtering is
- * not the place of the client, which is why this has been made a plugin for
- * SquirrelMail.  You may be better off using products such as Sieve or
- * Procmail to do your filtering so it happens even when SquirrelMail isn't
- * running.
- *
- * If you need help with this, or see improvements that can be made, please
- * email me directly at the address above.  I definitely welcome suggestions
- * and comments.  This plugin, as is the case with all SquirrelMail plugins,
- * is not directly supported by the developers.  Please come to me off the
- * mailing list if you have trouble with it.
- *
- * Also view plugins/README.plugins for more information.
- *
  * @version $Id$
  * @copyright (c) 1999-2005 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
@@ -25,7 +9,9 @@
  * @subpackage filters
  */
 
-@include_once (SM_PATH . 'plugins/filters/config.php');
+/** load config */
+if (file_exists(SM_PATH . 'plugins/filters/config.php'))
+    include_once (SM_PATH . 'plugins/filters/config.php');
 
 /**
  * Init Hooks
@@ -285,7 +271,7 @@ function filter_search_and_delete($imap_stream, $where, $what, $where_to, $user_
     } else {
         $category = 'ALL';
     }
-    $category .= ' NOT DELETED';
+    $category .= ' UNDELETED';
 
     if ($allow_charset_search &&
         isset($languages[$squirrelmail_language]['CHARSET']) &&
@@ -323,7 +309,7 @@ function filter_search_and_delete($imap_stream, $where, $what, $where_to, $user_
         if ($response == 'OK' && count($ids)) {
             if (sqimap_mailbox_exists($imap_stream, $where_to)) {
                  $should_expunge = true;
-                 sqimap_msgs_list_move ($imap_stream, $ids, $where_to);
+                 sqimap_msgs_list_move ($imap_stream, $ids, $where_to, false);
             }
         }
     }