I'm quite new to Dovecot but it has worked out for me pretty good so far for me.
I run dovecot with postfix and amavis and spamassassin and it works out all fine, mails get tagged as junk, sending, receiving, all fine.
Now I wanted to add the sieve plugin so mails get moved on the server and that does not work out. I wanted to start with a general script moving the junk to the junk folder but that is not happening.
So I searched the web and found the troubleshooting, which said, that sieve is propably not running. I did not manage to find any log entries made by sieve so this could be the problem. Here I found that you have to put sieve to the protocols, I guess in dovecot.conf.
I tried and dovecot didnt start anymore posting unkown protocol: sieve.
I added lmtp to the protocols as I want to use it and it was posted in another thread but I got the error: service(lmtp) accces failed: no such file or directory.
Some system infos:
OS: Debian 7
Dovecot Version: 2.1.7
Config Files:
dovecot.conf (reduced on changed/added)
protocols = imap pop3
plugin {
sieve_before = /var/vmail/sieve/spam-global.sieve
sieve_dir = /var/vmail/%d/%n/sieve/scripts/
sieve = /var/vmail/%d/%n/sieve/active-script.sieve
}
conf.d/20-lmtp.conf (created it)
protocol lmtp {
# Space separated list of plugins to load (default is global mail_plugins).
mail_plugins = $mail_plugins sieve
}
spam-global.sieve
require "fileinto";
if header :contains "X-Spam-Flag" "YES" {
fileinto "Spam";
}
How can I check, wether sieve is running?
Afaik Postfix needs to be configured to work with sieve. I'm not sure I did that so far but as long as sieve wont run, that wont solve the problem right?
Thanks for any help
Invalid
Best Answer
You say you had to create the file?
Sounds like you never installed the protocol plugin under dovecot.
First, DO NOT edit (or create) the installed
conf
files when avoidable. Make your own. Create a/etc/dovecot/local.cf
OR/etc/dovecot/conf.d/99-custom.conf
(for example).In newer Dovecot distro versions, the LDA (
15-lda.conf
) plugin is installed by default, but not the LMTP plugin (20-lmtp.conf
). You can use the LDA plugin. (Local Delivery Agent).If you still wish to use LMTP, you need to install the plugin:
sudo apt install dovecot-lmtpd
. If you had done that, you wouldn't need to create the.conf
file for it.The pertinent Sieve areas of my
/etc/dovecot/local.cf
:The pertinent Sieve areas of my
/etc/postfix/main.cf
(using dovecot lda/deliver):My
default.sieve
:Pertinent area of
/etc/amavis/conf.d/50-user
(or make your own:99-custom
) :Restart Dovecot and test port:
Dovecot debug output - can see it working:
Sieve now runs. Your question answered.
As far as anything I may have missed - each setup can vary. Please review some articles if you are still stuck. My sieve global rules store quarantine stuff in per-user 'Spam' folders (users are non-virtual). As pointed out, you probably need to edit your postfix main.cf (and master.cf if virtual users/vmail) as noted here to use Dovecot LDA. You also probably need to edit your content-filter (amavis-new for instance) as noted. There are articles out there for this.