[Dovecot] Sieve's spamtest always returns 0

Stephan Bosch stephan at rename-it.nl
Fri Dec 27 21:31:32 EET 2013


On 12/27/2013 6:04 AM, martin f krafft wrote:
>   X-Spam-Status: Yes, score=84.6 required=5.0 tests=…
>
> and so I configured spamtest in conf.d/90-plugin.conf like so:
>
>   sieve_spamtest_status_type = score
>   sieve_spamtest_status_header = X-Spam-Status: [^,]*,
score=(-?[[:digit:]]+\.[[:digit:]]).*

This configuration is incomplete. Your logs should show an error about
that. Testing with sieve-test shows:

stephan at klara:~/src/devel$ sieve-test  ~/frop.sieve ~/frop.eml
sieve-test(stephan): Error: sieve: spamtest: none of
sieve_spamtest_max_header or sieve_spamtest_max_value is configured
sieve-test(stephan): Error: sieve: spamtest: none of
sieve_spamtest_max_header or sieve_spamtest_max_value is configured
[...]

For example, your config should look like this (with max value 10; i.e.,
the value beyond which it is spam with 100% certainty):

sieve_spamtest_status_type = score
sieve_spamtest_status_header = X-Spam-Status: [^,]*,
score=(-?[[:digit:]]+\.[[:digit:]]).*
sieve_spamtest_max_value = 10

The sieve-test tool can be used to verify:

stephan at klara:~/src/devel$ sieve-test -t - -Tlevel=matching ~/frop.sieve
~/frop.eml

      ## Started executing script 'frop'
   3: spamtest test [percent=false]
   3:   extracted score=84.600, max=10.000, ratio=100 %
   3:   starting `:is' match with `i;ascii-casemap' comparator:
   3:   matching value `10'
   3:     with key `0' => 0
   3:   finishing match with result: not matched
   3: jump if result is false
   3:   jumping to line 4
        ## Finished executing script 'frop'
[...]

Regards,

Stephan.



More information about the dovecot mailing list