Some code cleanups to read_body.php
[squirrelmail.git] / plugins / filters / setup.php
index bb5d7ed636734fed5e00f88d855173afac0dfee4..1522a1a7f2a7a14b806713b5ff446ef98eef8a1a 100644 (file)
  * $Id$
  */
 
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../../');
+
+/* 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)
@@ -56,6 +62,15 @@ $AllowSpamFilters = true;
 global $SpamFilters_YourHop;
 $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
+ * should set SpamFilters_ShowCommercial to false.
+ */
+global $SpamFilters_ShowCommercial;
+$SpamFilters_ShowCommercial = false;
+
 /*
  * A cache of IPs we've already checked or are known bad boys or good boys
  * ie. $SpamFilters_DNScache["210.54.220.18"] = true;
@@ -65,7 +80,28 @@ $SpamFilters_YourHop = ' ';
  */
 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;
@@ -75,8 +111,10 @@ function squirrelmail_plugin_init_filters() {
     if ($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['special_mailbox']['filters'] = 'filters_special_mailbox';
+    $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 ) {
@@ -86,7 +124,7 @@ function filters_special_mailbox( $mb ) {
 
 }
 
-function squirrelmail_plugin_optpage_register_block() {
+function filters_optpage_register_block() {
     global $optpage_blocks;
     global $AllowSpamFilters;