Tracker: Bugs

5 [filters] multiple issues in filters plugin - ID: 1634735
Last Update: Settings changed ( jangliss )

People on irc suggested filing only one report.

1st issue (1.5.2cvs and 1.4.9a). in start_filters() function plugin checks
if spam filtering is enabled.
---
foreach($spamfilters as $filterskey=>$value) {
if ($value['enabled'] == 'yes') {
$AllowSpamFilters = true;
break;
}
}
---
Test is not correct. Plugin stores checkbox form input value. If value
attribute is not set in checkbox, it is set to 'on' string in Opera 9.10,
Firefox 1.5.0.7 and IE6. Setting is boolean. Use SMPREF_ON and SMPREF_OFF
constants instead of custom form string.

2nd issue. invalid return codes in spamhaus.org rbl
sbl.spamhaus.org return code is 127.0.0.2. 4,5,6 codes belong to
xbl.spamhaus.org. Plugin runs sbl.spamhaus.org query and checks for
127.0.0.6.

See http://www.spamhaus.org/xbl/index.lasso

3nd issue (1.4.x branch only) only one message is tested for spam in
stable. Plugin executes sqimap_run_command() and $read contains only first
FETCH response.

4th issue (1.4.x branch only)
id is used instead of uid

Plugin always uses id when messages are moved. sqimap_message_copy() and
sqimap_message_flag() need UID, if $uid_support is set to true.
$uid_support defaults to true. I also recommend collecting all spam ids and
executing one command instead of multiple imap commands.


Tomas Kuliavas ( tokul ) - 2007-01-13 15:40

5

Closed

Fixed

Jonathan Angliss

Specific Plugin

None

Public


Comments ( 9 )

Date: 2009-01-04 00:03
Sender: janglissProject AdminAccepting Donations

The bug you reported has already been fixed, and the fix is committed to
the repository. Please update to the latest version in the repository or
use a new snapshot. Note that the snapshots might be delayed 24 hours
compared to the repository.

If for some reason your problem still exists, please update this bug
report with that information.

Thank you for your help!


Date: 2007-03-07 06:32
Sender: janglissProject AdminAccepting Donations


Yes, and I was awaiting feedback on the patch. I've not added XBL support
on the list, but it is something we can consider. I've modified the code
to allow for it however. I've also corrected the 'on' !== 'yes' issue.
Stable will probably require a good fixing that won't get in before this
release.

There are a couple of other things I wanted to add to fix list for this
plugin, all probably require a little bit of time, and too substantial to
get in before the upcoming release.


Date: 2007-03-06 01:50
Sender: kinkProject AdminAccepting Donations


Are you working on this Jon? I'd prefer it if at least the straightforward
things from this report are fixed for the upcoming stable.


Date: 2007-01-19 18:02
Sender: tokul


If you are planning to include xbl support, see
http://www.spamhaus.org/zen/index.lasso.


Date: 2007-01-19 03:24
Sender: janglissProject AdminAccepting Donations


I've altered the way blacklist lookups are handled. When doing a lookup
for a host, if the host is not on the blacklist, nothing is returned.
gethostbyname (http://php.net/gethostbyname) returns the input string if no
host is matched. This can make the extension for sbl, to sbl-xbl a case of
changing just the host.

I've attached a patch for the dev branch for your review, I will take a
look at the stable stuff now.
File Added: 1634735_filters.patch


Date: 2007-01-18 07:54
Sender: tokul


typecast setting when you read it in load_spam_filters() function or test
$value['enabled'] without comparing it to SMPREF_ON constant. SquirrelMail
stores setting only when it is enabled. 'yes' and 'on' strings will be
converted to boolean true. Zero (SMPREF_OFF) is converted to boolean
false.

----
define('SMPREF_ON',1);
$var = (bool) 'on';

if ($var == SMPREF_ON) {
echo 'Match';
} else {
echo 'No Match';
}
----
$var = 'on';

if ($var) {
echo 'Match';
} else {
echo 'No Match';
}
----

Re: Should we extend the plugin to check for sbl-xbl?

-$filters['SPAMhaus']['result'] = '127.0.0.6';
+$filters['SPAMhaus']['result'] = '127.0.0.2';

is simple bug fix. Testing for multiple result values is a new feature and
requires more coding.


Date: 2007-01-18 07:03
Sender: janglissProject AdminAccepting Donations


define{'SMPREF_ON',1);
$var = 'on';
if ($var == SMPREF_ON) {
echo 'Match';
} else {
echo 'No Match';
}


This code uses the same logic we'd be changing to. The problem is, PHP
doesn't consider ('on' == 1) as a true boolean match. At least not with
PHP5.1.x. Though I vaguely remember 'on','1', and 1 all being treated as
the boolean TRUE in the past, the documentation is very specific on what is
considered false, everything else is true.

I will need to reset the save of the prefs to store as SMPREF_ON to use
the value 1, and then still do a string comparison, for those with old
string values. Unless I'm missing something.


Date: 2007-01-15 03:51
Sender: janglissProject AdminAccepting Donations


Checking on the page you reference, sbl. only returns 127.0.0.2. sbl-xbl.
returns 2,4,5,6. xbl. returns 4,5,6. Should we extend the plugin to check
for sbl-xbl? Or fix the bug, and point it to .2? :) In either case, I
think the ['result'] should be converted to an array, and the check should
see if it is an array before comparison. Changes would be minimal then.


Date: 2007-01-14 07:35
Sender: janglissProject AdminAccepting Donations


Thanks, I shall take a look. Issue 1 is an easy resolve. Issue 2 might
require us to change the code a little to use an array of values, but
shouldn't be too difficult.

3 might be a little harder, and 4 shouldn't be too difficult.

I will check on the collection of spam items before the move is called,
should save the IMAP server a bit.


Attached File ( 1 )

Filename Description Download
1634735_filters.patch Filters patch - Devel Download

Changes ( 5 )

Field Old Value Date By
status_id Open 2009-01-04 00:17 jangliss
close_date - 2009-01-04 00:17 jangliss
resolution_id None 2009-01-04 00:03 jangliss
File Added 211987: 1634735_filters.patch 2007-01-19 03:24 jangliss
assigned_to nobody 2007-01-14 07:35 jangliss