2
votes

I followed the guide at https://wiki.archlinux.org/index.php/Dovecot#Sieve

In one portion it says to create /var/lib/dovecot/sieve/global_sieves/move_to_spam_folder.sieve with:

require "spamtestplus";
require "fileinto";
require "relational";
require "comparator-i;ascii-numeric";

if spamtest :value "ge" :comparator "i;ascii-numeric" "5" {
  fileinto "Junk";
}

Next is says to run:

sievec /var/lib/dovecot/sieve/global_sieves

When I do I receive an error about the "spamtestplus":

move_to_spam_folder: line 1: error: require command: unknown Sieve capability `spamtestplus'.
move_to_spam_folder: line 6: error: unknown test 'spamtest' (only reported once at first occurrence).
move_to_spam_folder: error: validation failed.
sievec(root): Error: failed to compile sieve script '/var/lib/dovecot/sieve/global_sieves/move_to_spam_folder.sieve'

Can someone please provide some advice? Usually the Arch wiki is pretty dead-on but so far no amount of googling/tweaking is getting this to work.

2

2 Answers

0
votes

try using only

require "fileinto"

complete example code:

require "fileinto";
if header :contains "X-Spam-Flag" "YES" {
  fileinto "Junk"; 
}
0
votes

You need to enable and configure the spamtestplus Sieve extension in order to use it. The page you referenced has an example of configuration for SpamAssassin, which includes setting sieve_extensions = +spamtest +spamtestplus in the 90-sieve.conf file:

plugin {
  sieve_extensions = +spamtest +spamtestplus

  sieve_spamtest_status_type = score
  sieve_spamtest_status_header = \ 
    X-Spam_score: (-?[[:digit:]]+\.[[:digit:]]).* 
  sieve_spamtest_max_value = 5.0 

  sieve_before = /var/lib/dovecot/sieve/global_sieves/move_to_spam_folder.sieve
}

Also refer to the Dovecot Pigeonhole documentation on setting up the spamtest/virustest extensions for more information.