Initial groundwork to use phpdocumentor.
[squirrelmail.git] / plugins / filters / setup.php
index a3906273af4070abe5a5b52fefa3bbeec5301dad..5773b7e63fe121890632a702163fa8532354d064 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Message and Spam Filter Plugin
  *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * This plugin filters your inbox into different folders based upon given
  * Also view plugins/README.plugins for more information.
  *
  * $Id$
+ * @package plugins
+ * @subpackage filters
  */
 
+/** SquirrelMail required files. */
+require_once(SM_PATH . 'plugins/filters/filters.php');
+
 /*
  * Set this to true if you have problems -- check the README file
  * Note:  This doesn't work all of the time (No idea why)
@@ -60,10 +65,10 @@ $SpamFilters_YourHop = ' ';
  * Some of the SPAM filters are COMMERCIAL and require a fee. If your users
  * select them and you're not allowed to use them, it will make SPAM filtering
  * very slow. If you don't want them to even be offered to the users, you
- * set SpamFilters_ShowCommercial to false.
+ * should set SpamFilters_ShowCommercial to false.
  */
 global $SpamFilters_ShowCommercial;
-$SpamFilters_ShowCommercial = true;
+$SpamFilters_ShowCommercial = false;
 
 /*
  * A cache of IPs we've already checked or are known bad boys or good boys
@@ -74,19 +79,50 @@ $SpamFilters_ShowCommercial = true;
  */
 global $SpamFilters_DNScache;
 
-require_once ('../plugins/filters/filters.php');
+/*
+ * Absolute path to the bulkquery program. Leave blank if you don't have
+ * bulkquery compiled, installed, and lwresd running. See the README file
+ * in the bulkquery directory for more information on using bulkquery.
+ */
+global $SpamFilters_BulkQuery;
+$SpamFilters_BulkQuery = '';
+
+/*
+ * Do you want to use a shared file for the DNS cache or a session variable?
+ * Using a shared file means that every user can benefit from any queries
+ * made by other users. The shared file is named "dnscache" and is in the
+ * data directory.
+ */
+global $SpamFilters_SharedCache;
+$SpamFilters_SharedCache = true;
+
+/*
+ * How long should DNS query results be cached for by default (in seconds)?
+ */
+global $SpamFilters_CacheTTL;
+$SpamFilters_CacheTTL = 7200;
 
 function squirrelmail_plugin_init_filters() {
     global $squirrelmail_plugin_hooks;
-    global $mailbox, $imap_stream, $imapConnection;
+
+    if (isset($_GET['mailbox'])) {
+        $mailbox = $_GET['mailbox'];
+    }
+    elseif (isset($_POST['mailbox'])) {
+        $mailbox = $_POST['mailbox'];
+    }
+    else {
+        $mailbox = 'INBOX';
+    }
 
     $squirrelmail_plugin_hooks['left_main_before']['filters'] = 'start_filters';
-    if ($mailbox == 'INBOX') {
+    if (isset($mailbox) && $mailbox == 'INBOX') {
         $squirrelmail_plugin_hooks['right_main_after_header']['filters'] = 'start_filters';
     }
-    $squirrelmail_plugin_hooks['optpage_register_block']['filters'] = 'squirrelmail_plugin_optpage_register_block';
+    $squirrelmail_plugin_hooks['optpage_register_block']['filters'] = 'filters_optpage_register_block';
 #    $squirrelmail_plugin_hooks['special_mailbox']['filters'] = 'filters_special_mailbox';
     $squirrelmail_plugin_hooks['rename_or_delete_folder']['filters'] = 'update_for_folder';
+    $squirrelmail_plugin_hooks['webmail_bottom']['filters'] = 'start_filters';
 }
 
 function filters_special_mailbox( $mb ) {
@@ -96,7 +132,7 @@ function filters_special_mailbox( $mb ) {
 
 }
 
-function squirrelmail_plugin_optpage_register_block() {
+function filters_optpage_register_block() {
     global $optpage_blocks;
     global $AllowSpamFilters;