[ingo] comparing custom header to zero => You cannot create empty conditions ; -(

Thomas Bätzler t.baetzler at bringe.com
Tue Feb 17 15:33:21 UTC 2009


Hi,

this is with regard to INGO H3 1.2 as shipped in Horde Webmail 1.1.5
using a sieve backend.

I'm trying to set up a rule to match for the custom header line
"X-GMX-Antispam: 0", which I would expect to look something like this:

  if header :value "eq" :comparator "i;ascii-numeric" "X-GMX-Antispam"
"0"  {
      keep;
  }

If I use Ingo to create a rule like this ("Self-defined Header"
"X-GMX-Antispam" "Is" "0"), I get the error shown above.

I've tracked this message to this block in rule.php at line 91:

            if ($actionID == 'rule_save'
                && empty($value[$key])
                && $condition['match'] != 'exists'
                && $condition['match'] != 'not exist') {
                $notification->push(sprintf(_("You cannot create empty
conditions. Please fill in a value for \"%s\"."), $condition['field']),
'horde.error');
                $valid = false;
            }

I haven't checked the version history of this file but I suspect that
the empty() is part f a fix for http://bugs.horde.org/ticket/5641

I've tried to amend the test to exclude the 0 value, but then I end
up with a broken sieve script:

  6: # Whitelisted by GMX
  7: if No strings specified {
  8:     keep;
  9: }

Curiously, if I use the comparator "equal to" instead of "is" with any
value, I get

  6: # Whitelisted by GMX
  7: if true {
  8:     keep;
  9: }

Could somebody please help me to fix this?

TIA,
Thomas



More information about the ingo mailing list