<?php
-
/**
- * Message and Spam Filter Plugin
- *
- * Copyright (c) 1999-2004 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
+ * 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
*
* Also view plugins/README.plugins for more information.
*
- * $Id$
+ * @version $Id$
+ * @copyright (c) 1999-2004 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @package plugins
* @subpackage filters
*/
/**
-*
-*/
+ * FIXME: Undocumented function
+ * @access private
+ */
function filters_SaveCache () {
global $data_dir, $SpamFilters_DNScache;
fclose($fp);
}
+/**
+ * FIXME: Undocumented function
+ * @access private
+ */
function filters_LoadCache () {
global $data_dir, $SpamFilters_DNScache;
}
}
+/**
+ * FIXME: Undocumented function
+ * @access private
+ */
function filters_bulkquery($filters, $IPs) {
global $SpamFilters_YourHop, $attachment_dir, $username,
$SpamFilters_DNScache, $SpamFilters_BulkQuery,
}
}
+/**
+ * FIXME: Undocumented function
+ * @access private
+ */
function start_filters() {
global $mailbox, $imapServerAddress, $imapPort, $imap,
$imap_general, $filters, $imap_stream, $imapConnection,
# }
}
+/**
+ * FIXME: Undocumented function
+ * @access private
+ */
function user_filters($imap_stream) {
global $data_dir, $username;
$filters = load_filters();
}
}
+/**
+ * FIXME: Undocumented function
+ * @access private
+ */
function filter_search_and_delete($imap_stream, $where, $what, $where_to, $user_scan,
$should_expunge) {
- global $languages, $squirrelmail_language, $allow_charset_search,
- $uid_support, $imap_server_type;
+ global $languages, $squirrelmail_language, $allow_charset_search, $imap_server_type;
+
if ($user_scan == 'new') {
$category = 'UNSEEN';
} else {
}
/* read data back from IMAP */
- $read = sqimap_run_command($imap_stream, $search_str, true, $response, $message, $uid_support);
+ $read = sqimap_run_command($imap_stream, $search_str, true, $response, $message, TRUE);
// This may have problems with EIMS due to it being goofy
return $should_expunge;
}
-// These are the spam filters
+/**
+ * FIXME: Undocumented function
+ * @access private
+ */
function spam_filters($imap_stream) {
- global $data_dir, $username, $uid_support;
+ global $data_dir, $username;
global $SpamFilters_YourHop;
global $SpamFilters_DNScache;
global $SpamFilters_SharedCache;
if ($filters_spam_scan != 'new') {
$query = 'FETCH 1:* (BODY.PEEK[HEADER.FIELDS (Received)])';
} else {
- $read = sqimap_run_command($imap_stream, 'SEARCH UNSEEN', true, $response, $message, $uid_support);
+ $read = sqimap_run_command($imap_stream, 'SEARCH UNSEEN', true, $response, $message, TRUE);
if ($response != 'OK' || trim($read[0]) == '* SEARCH') {
$query = 'FETCH 1:* (BODY.PEEK[HEADER.FIELDS (RECEIVED)])';
} else {
}
}
-// Does the loop through each enabled filter for the specified IP address.
-// IP format: $a.$b.$c.$d
+/**
+ * FIXME: Undocumented function
+ * Does the loop through each enabled filter for the specified IP address.
+ * IP format: $a.$b.$c.$d
+ * @access private
+ */
function filters_spam_check_site($a, $b, $c, $d, &$filters) {
global $SpamFilters_DNScache, $SpamFilters_CacheTTL;
foreach ($filters as $key => $value) {
return 0;
}
+/**
+ * FIXME: Undocumented function
+ * @access private
+ */
function load_filters() {
global $data_dir, $username;
return $filters;
}
+/**
+ * FIXME: Undocumented function
+ * @access private
+ */
function load_spam_filters() {
global $data_dir, $username, $SpamFilters_ShowCommercial;
$filters['MAPS RSS']['dns'] = 'relays.mail-abuse.org';
$filters['MAPS RSS']['result'] = '127.0.0.2';
$filters['MAPS RSS']['comment'] =
- _("COMMERCIAL - Servers that are configured (or misconfigured) to allow spam to be relayed through their system will be banned with this. Another good one to use.");
+ _("COMMERCIAL - Servers that are configured (or misconfigured) to allow spam to be relayed through their system will be banned with this. Another good one to use.");
$filters['MAPS DUL']['prefname'] = 'filters_spam_maps_dul';
$filters['MAPS DUL']['name'] = 'MAPS Dial-Up List';
$filters['MAPS DUL']['dns'] = 'dialups.mail-abuse.org';
$filters['MAPS DUL']['result'] = '127.0.0.3';
$filters['MAPS DUL']['comment'] =
- _("COMMERCIAL - Dial-up users are often filtered out since they should use their ISP's mail servers to send mail. Spammers typically get a dial-up account and send spam directly from there.");
+ _("COMMERCIAL - Dial-up users are often filtered out since they should use their ISP's mail servers to send mail. Spammers typically get a dial-up account and send spam directly from there.");
$filters['MAPS RBLplus-RBL']['prefname'] = 'filters_spam_maps_rblplus_rbl';
$filters['MAPS RBLplus-RBL']['name'] = 'MAPS RBL+ RBL List';
return $filters;
}
+/**
+ * FIXME: Undocumented function
+ * @access private
+ */
function remove_filter ($id) {
global $data_dir, $username;
removePref($data_dir, $username, 'filter' . $id);
}
+/**
+ * FIXME: Undocumented function
+ * @access private
+ */
function filter_swap($id1, $id2) {
global $data_dir, $username;
}
}
-/* This update the filter rules when
- renaming or deleting folders */
+/**
+ * This update the filter rules when renaming or deleting folders
+ * @param array $args
+ * @access private
+ */
function update_for_folder ($args) {
$old_folder = $args[0];
$new_folder = $args[2];
}
}
}
-/*
+
+/**
* Function extracted from sqimap_get_small_header_list.
* The unused FETCH arguments and HEADERS are disabled.
+ * @access private
*/
function filter_get_headers ($imap_stream, $query) {
- global $uid_support;
/* Get the small headers for each message in $msg_list */
- $read_list = sqimap_run_command_list ($imap_stream, $query, false, $response, $message, $uid_support);
+ $read_list = sqimap_run_command_list ($imap_stream, $query, false, $response, $message, TRUE);
if (isset($response) && $response != 'OK') {
return false;
return $msgs;
}
-?>
\ No newline at end of file
+/**
+ * Display formated error message
+ * @param string $string text message
+ * @return string html formated text message
+ * @access private
+ */
+function do_error($string) {
+ global $color;
+ echo "<p align=\"center\"><font color=\"$color[2]\">";
+ echo $string;
+ echo "</font></p>\n";
+}
+?>