--- ingo/lib/Script/sieve.php.orig Mon May 1 18:19:15 2006
+++ ingo/lib/Script/sieve.php Mon May 1 18:44:53 2006
@@ -417,12 +417,22 @@
'folder' => $spam->getSpamFolder()
));
- $vals = array('headers' => $GLOBALS['conf']['spam']['header'],
- 'match-type' => ':contains',
- 'strings' => str_repeat($GLOBALS['conf']['spam']['char'],
- $spam->getSpamLevel()),
- 'comparator' => 'i;ascii-casemap');
- $test = &new Sieve_Test_Header($vals);
+ if($GLOBALS['conf']['spam']['compare'] == 'numeric') {
+ $vals = array('headers' => $GLOBALS['conf']['spam']['header'],
+ 'comparison' => 'ge',
+ 'value' => $spam->getSpamLevel());
+ $test = &new Sieve_Test_Relational($vals);
+ } elseif ($GLOBALS['conf']['spam']['compare'] == 'string') {
+ $vals = array('headers' => $GLOBALS['conf']['spam']['header'],
+ 'match-type' => ':contains',
+ 'strings' => str_repeat($GLOBALS['conf']['spam']['char'],
+ $spam->getSpamLevel()),
+ 'comparator' => 'i;ascii-casemap');
+ $test = &new Sieve_Test_Header($vals);
+ }
+
+ $actions[] = &new Sieve_Action_Stop();
+
$if = &new Sieve_If($test);
$if->setActions($actions);
$spamBlocks[] = $if;