Trimming whitespace and replacing tabs
[squirrelmail.git] / plugins / filters / filters.php
index 9414fe14b5f9e4afa7d9608c1e05be6d526be49c..c326a1f5a7942b1f2cc85f5e044b507455c21d9e 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,6 +9,7 @@
  * @subpackage filters
  */
 
+/** load config */
 if (file_exists(SM_PATH . 'plugins/filters/config.php'))
     include_once (SM_PATH . 'plugins/filters/config.php');
 
@@ -58,7 +43,7 @@ function filters_init_hooks () {
 function filters_optpage_register_block() {
     global $optpage_blocks, $AllowSpamFilters;
     if (!file_exists(SM_PATH . 'plugins/filters/config.php')) return;
-    
+
     $optpage_blocks[] = array(
         'name' => _("Message Filters"),
         'url'  => SM_PATH . 'plugins/filters/options.php',
@@ -179,9 +164,9 @@ function filters_bulkquery($filters, $IPs) {
 function start_filters() {
     global $imapServerAddress, $imapPort, $imap_stream, $imapConnection,
            $UseSeparateImapConnection, $AllowSpamFilters;
-           
+
     if (!file_exists(SM_PATH . 'plugins/filters/config.php')) return;
-    
+
     sqgetGlobalVar('username', $username, SQ_SESSION);
     sqgetGlobalVar('key',      $key,      SQ_COOKIE);
 
@@ -246,7 +231,7 @@ function user_filters($imap_stream) {
                   $filters[$i]['what'], $filters[$i]['folder'], $filters_user_scan, $expunge);
         } else if ($filters[$i]['where'] == 'Message Body') {
             $expunge = filter_search_and_delete($imap_stream, 'BODY',
-                  $filters[$i]['what'], $filters[$i]['folder'], $filters_user_scan, $expunge);                  
+                  $filters[$i]['what'], $filters[$i]['folder'], $filters_user_scan, $expunge);
         } else {
             /*
             *  If it's a normal TO, CC, SUBJECT, or FROM, then handle it
@@ -269,7 +254,7 @@ function user_filters($imap_stream) {
  * @param string $what String to search for
  * @param string $where_to Folder it will move to
  * @param string $user_scan Whether to search all or just unseen
- * @param string $should_expunge 
+ * @param string $should_expunge
  * @param boolean $where Which part of location to search
  * @access private
  */
@@ -815,7 +800,7 @@ function remove_filter ($id) {
 /**
  * Swaps two filters
  * @param int $id1 ID of first filter to swap
- * @param int $id2 ID of second filter to swap 
+ * @param int $id2 ID of second filter to swap
  * @access private
  */
 function filter_swap($id1, $id2) {
@@ -838,7 +823,7 @@ function filter_swap($id1, $id2) {
 function update_for_folder ($args) {
 
     if (!file_exists(SM_PATH . 'plugins/filters/config.php')) return;
-    
+
     $old_folder = $args[0];
     $new_folder = $args[2];
     $action = $args[1];