[Dovecot] Sieve "header :value" test does not work

Tom Hendrikx tom at whyscream.net
Wed Sep 7 15:40:09 EEST 2011


On 06/09/11 21:21, Tom Hendrikx wrote:
> On 06/09/11 21:11, Tom Hendrikx wrote:
>> hi,
>>
>> After following some examples and searching for sieve samples in this ml
>> history, I'm quite sure that the following sieve snippet should give no
>> surprises:
>>
>> if header :value "ge" :comparator "i;ascii-numeric" "X-Header-Name"
>> "0.99" { /* do something */ }
>>
>> However the Pigeonhole Sieve 0.2.3 on dovecot 2.0.14 gives me following
>> error:
>>
>> test: line 3: error: unknown tagged argument ':value' for the header
>> test (reported only once at first occurence).
>> test: error: validation failed.
>>
>> What obvious mistake am I failing to see here?
>>
> 
> To answer my own question (which was found by grepping through
> /usr/share/doc/dovecot-2.0.14/sieve/rfc/*bz2): including the
> "relational" extension in the "require" statement adds support for this
> test.
> 
> Sorry for the noise :/
> --
> Tom
> 

The above snippet poses some other issue that I cannot easily solve: the
ascii-numeric comparator only handles integer values.

All 0.xxxx header values are truncated to 0 by the comparator, just like
the sieve script value "0.95". After comparision, this results in true
for all cases.

I don't really see a way to interact with floats in sieve, other than
using regular expressions. However this gets clumsy/hairy quite fast
when you're matching a hypothetical header value >=0.73 in stead of >=0.99.

Any ideas?

-- 
Regards,
	Tom



More information about the dovecot mailing list