1

CentOS 6.5 x64

I'm trying to apply a Sieve filter to my mailserver (Postfix + Dovecot + Spamassassin) to automatically move spam mails to my Junk folder.

I've added sieve to my /etc/dovecot/dovecot.conf protocols.

This is my /etc/dovecot/conf.d/90-sieve.conf:

plugin {
  sieve = ~/.dovecot.sieve
  sieve_global_path = /var/lib/dovecot/sieve/default.sieve
  sieve_after = /var/lib/dovecot/sieve
  sieve_dir = ~/sieve
  sieve_global_dir = /var/lib/dovecot/sieve/
}

This is the content of /var/lib/dovecot/sieve/default.sieve:

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

Which was compiled with sievec /var/lib/dovecot/sieve/default.sieve

My Spamassassin works correctly, in fact it adds the [SPAM] string before the subject of the emails and the X-Spam-Flag is set to YES.

I've already restarted dovecot and postfix.

No errors are reported in /var/log/maillog, running cat /var/log/maillog | grep sieve does not return anything.

The problem: mails are not moved to Junk folder.

Looks like the sieve filter is not executed at all... How can I fix it?

1

I've solved it upgrading to the newest version of Dovecot from the enterprise repositories.

  • I have the same problem more than 2 years later. What version are you running to fix the issue? I'm running Ubuntu 16.04 LTS and Dovecot 2.2.22 (fe789d2). – bynicolas Dec 13 '16 at 1:46
0
  • sieve_global_path The deprecated name for the sieve_default setting (Pigeonhole v0.2 and earlier).

  • sieve_default (v0.3+) The location of the default personal sieve script file which gets executed ONLY if user's private Sieve script does no exist

Check the multiscript section for instructions on running global Sieve scripts before and after the user's personal script.

Ref: Dovecot Docs

  • I already use sieve_after and no personal sieve scripts are defined. – Fez Vrasta Jul 7 '14 at 10:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.