In Centos 6.4 i use postfix with LDA Dovecot and webmail squiremail, amavis-new with spamassassin. Spam is marked with subject Spam. I want in my squirelmail to filter spam messages an move in to folder spam. I use sieve script /var/lib/dovecot/sieve/default.sieve

 require "fileinto";
  if exists "X-Spam-Flag" {
          if header :contains "X-Spam-Flag" "NO" {
          } else {
          fileinto "Spam";
  if header :contains "subject" ["***Spam***"] {
    fileinto "Spam";

but still i have spam in my INBOX folder besides the Spam folder

commandline sievec otuput

 #sievec /var/lib/dovecot/sieve/default.sieve
    sievec(root): Error: user root: Initialization failed: Initializing mail storage from environment MAIL failed: Ambiguous mail location setting, don't know what to do with it: /var/spool/mail/root (try prefixing it with mbox: or maildir:)
    sievec(root): Fatal: Invalid user settings. Refer to server log for more information.
  • You saying the sieved messages are still not being filtered, or that it isn't retroactively applying the filter? – NickW Aug 15 '13 at 12:41
  • Still I have new messages marked as spam in my inbox – mardon Aug 15 '13 at 16:18
  • Any errors in the dovecot log file? – NickW Aug 15 '13 at 16:19
  • In my configuation dovecot.log no exists – mardon Aug 15 '13 at 16:31
  • in /var/log/maillog isnt any error – mardon Aug 15 '13 at 19:06

I had a similar problem and in my case the mail_location variable wasn't being auto detected correctly.

At /etc/dovecot/conf.d/10-mail.conf.erb set:

mail_location = maildir:~/Maildir

This will replace the default which is auto-detect.

You can see a further explanation at the comments at the same file.

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.