* * Licensed under the GNU GPL. For full terms see the file COPYING that came * with the Squirrelmail distribution. * * $Id: addspamrule.php,v 1.6 2004/05/12 14:16:09 avel Exp $ */ /** * Wizard-like form for adding new spam rule. */ define('SM_PATH','../../'); require_once(SM_PATH . 'include/validate.php'); require_once(SM_PATH . 'include/load_prefs.php'); require_once(SM_PATH . 'functions/page_header.php'); require_once(SM_PATH . 'functions/imap.php'); include "config.php"; require_once "avelsieve_support.inc.php"; require_once "table_html.php"; require_once "addrule_html.php"; require_once "buildrule.php"; require_once "sieve.php"; sqsession_is_active(); if(isset($_POST['cancel'])) { header("Location: ./table.php"); exit; } if(isset($_GET['edit'])) { $edit = $_GET['edit']; } elseif(isset($_POST['edit'])) { $edit = $_POST['edit']; } if(isset($edit)) { /* Have this handy: type of current rule */ $type = $_SESSION['rules'][$edit]['type']; /* and the rule itself */ $rule = $_SESSION['rules'][$edit]; if($type != 10) { header("Location: edit.php?edit=$edit"); } if(isset($_GET['dup'])) { $dup = true; } } if(isset($_POST['spamrule_advanced'])) { $spamrule_advanced = true; } elseif (isset($edit) && isset($rule['advanced'])) { $spamrule_advanced = true; } else { $spamrule_advanced = false; } $spamrule = true; global $spamrule; /* Spam Rule variables */ /* If we need to get spamrule RBLs from LDAP, then do so now. */ if(isset($_SESSION['spamrule_rbls'])) { $spamrule_rbls = $_SESSION['spamrule_rbls']; } elseif(isset($spamrule_tests_ldap) && $spamrule_tests_ldap == true && !isset($_SESSION['spamrule_rbls'])) { include_once('spamrulefunctions.php'); $spamrule_rbls = avelsieve_askldapforrbls(); $_SESSION['spamrule_rbls'] = $spamrule_rbls; } if(isset($_POST['tests'])) { $tests = $_POST['tests']; } elseif (isset($edit) && isset($rule['tests'])) { $tests = $rule['tests']; } else { $tests = array_keys($spamrule_tests); } if(isset($_POST['score'])) { $score = $_POST['score']; } elseif (isset($edit) && isset($rule['score'])) { $score = $rule['score']; } else { $score = $spamrule_score_default; } if(isset($_POST['whitelist_add']) || isset($_POST['whitelistvalue'])) { $j=0; for($i=0; $i' . _("All incoming mail is checked for unsolicited commercial content (SPAM) and marked accordingly. This special rule allows you to configure what to do with such messages once they arrive to your Inbox.") . '

'; if(!$spamrule_advanced) { print '

'. sprintf( _("Select %s to add the predefined rule, or select the advanced SPAM filter to customize the rule."), '' . _("Add Spam Rule") . '' ) . '

'; print '

'; } else { /* include_once(SM_PATH . 'plugins/filters/filters.php'); $spamfilters = load_spam_filters(); */ print ''; print ''; } if(isset($junkprune_saveme)) { print ''; } /* STOP */ print '
'; print ''; print_section_end(); print_all_sections_end(); if(isset($edit)) { print ''; if(isset($dup)) { print ''; print ''; } else { print ''; } print ''; } else { printaddbuttons(); } printfooter2(); ?>