- Fix Priority and Receipt compose options being reset after return from
HTML addressbook, and allow returning from an empty address book (#1673056).
- Do not special case the 'None' folder.
+ - Fixes for filters issues (#1634735).
Version 1.5.1 (branched on 2006-02-12)
--------------------------------------
$SpamFilters_CacheTTL;
/**
- * load required functions. Plugin depends on IMAP functions and they are not
+ * load required functions. Plugin depends on IMAP functions and they are not
* loaded in src/webmail.php
*/
include_once (SM_PATH . 'functions/imap.php');
$AllowSpamFilters = false;
foreach($spamfilters as $filterskey=>$value) {
- if ($value['enabled'] == 'yes') {
+ if ($value['enabled'] == SMPREF_ON) {
$AllowSpamFilters = true;
break;
}
foreach ($filters as $key => $value) {
if ($filters[$key]['enabled']) {
if ($filters[$key]['dns']) {
+ /**
+ * RFC allows . on end of hostname to force domain lookup
+ * to not use search domain from resolv.conf
+ */
$filter_revip = $d . '.' . $c . '.' . $b . '.' . $a . '.' .
- $filters[$key]['dns'];
+ $filters[$key]['dns'] . '.';
if(!isset($SpamFilters_DNScache[$filter_revip]['L']))
$SpamFilters_DNScache[$filter_revip]['L'] = '';
$SpamFilters_DNScache[$filter_revip]['T'] =
time() + $SpamFilters_CacheTTL;
}
- if ($SpamFilters_DNScache[$filter_revip]['L'] ==
- $filters[$key]['result']) {
+
+ /**
+ * gethostbyname returns ip if resolved, or returns original
+ * host query if no resolution
+ */
+ if ($SpamFilters_DNScache[$filter_revip]['L'] != $filter_revip) {
return 1;
}
}
$filters['SPAMhaus']['name'] = 'SPAMhaus Lists';
$filters['SPAMhaus']['link'] = 'http://www.spamhaus.org';
$filters['SPAMhaus']['dns'] = 'sbl.spamhaus.org';
- $filters['SPAMhaus']['result'] = '127.0.0.6';
+ $filters['SPAMhaus']['result'] = '127.0.0.2';
$filters['SPAMhaus']['comment'] =
_("FREE - SPAMhaus - A list of well-known SPAM sources.");
_("FREE - Distributed Sender Boycott List - UN-Confirmed Relays");
foreach ($filters as $Key => $Value) {
- $filters[$Key]['enabled'] = getPref($data_dir, $username, $filters[$Key]['prefname']);
+ $filters[$Key]['enabled'] = (bool)getPref($data_dir, $username, $filters[$Key]['prefname']);
}
return $filters;