[Tickets #5843] Re: spam-filtering for maildrop

bugs at bugs.horde.org bugs at bugs.horde.org
Sun Nov 18 20:44:36 UTC 2007


Ticket URL: http://bugs.horde.org/ticket/?id=5843
 Ticket             | 5843
 Updated By         | horde at nospam.obeliks.de
 Summary            | spam-filtering for maildrop
 Queue              | Ingo
 Version            | HEAD
 Type               | Enhancement
 State              | Resolved
 Priority           | 2. Medium
 Owners             | Chuck Hagenbuch

horde at nospam.obeliks.de (2007-11-18 12:44) wrote:

Actually, this patch will not work at all. 

The way maildrop condition generation works atm, each condition starts
with /^ 
(see this line: $string .= '/^' . $condition['field'] . ':\\s*';),
which starts a regular expression. 
Like I said in bug #5816, implementing numerical comparisons would require
more changes to the script.

In a maildrop script, a numerical comparison (e.g. >=) for a certain
header field (e.g. HeaderName) and a certain value (e.g. 5, from
(int)$condition['value']) would best be implemented as 
(/^HeaderName:\s*(\d+(\.\d+)?)/h && $MATCH1 >= 5)

This would work fine with the current script generation algorithm, except
an opening parenthesis would have to be added at the beginning of a
condition for numerical comparisons, and the second part of the condition
would have to be added AFTER the regular expression is closed and also
AFTER the flags are added (which is why I didn't implement this in the
above mentioned bug/patch, but tried to restructure the whole thing to make
it more readable).

However, If I got that right, the current HEAD of the maildrop.php however
will produce something like
/^HeaderName:\s* >= 5/h
which is of course complete bogus.

Please revert the changes until a proper patch is provided.

More information about the bugs mailing list