/**
* 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
* @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
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',
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);
$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
* @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
*/
/**
* 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) {
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];