2

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 Answers2

0

try using only

require "fileinto"

complete example code:

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

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.

  • I have the same problem as OP but setting `sieve_extensions = +spamtest +spamtestplus` in `90-sieve.conf` did not work for me. How else might this be troubleshot? – Hugh Guiney Aug 30 '17 at 09:57
  • @HughGuiney: You could take a look at general [Dovecot Sieve Troubleshooting](https://wiki.dovecot.org/Pigeonhole/Sieve/Troubleshooting) & [Dovecot Troubleshooting](https://wiki2.dovecot.org/WhyDoesItNotWork) and try to confirm that your config files are being read as you intend. If you have further trouble, you should probably post your own question on SuperUser/ServerFault. This really isn't a programming thing so isn't on topic here on StackOverflow. –  Aug 30 '17 at 12:29