[Dovecot] Dovecot + Sieve
Hi guys.
I installed dovecot 1.0.3 with sieve plugin. It looks like sieve is loaded fine by dovecot [1]. I set up dovecot to use sieve globally: protocol lda { mail_plugins = cmusieve quota sieve_global_dir = /usr/local/etc/sieve/Junk ..... }
And created a sieve file which is supposed to move all the Spam marked by dspam to users's Junk folder (listed as Junk in the subscriptions file) : require ["fileinto"]; # Move spam to Junk folder if header :contains ["X-DSPAM-Result:"] "Spam" { fileinto "Junk"; # Stop here so that we do not reply on spams stop; }
I also set up postfix to use pipe mail through dovecot: mailbox_command = /usr/local/libexec/dovecot/deliver
The problem is dovecot seems to be ignoring my sieve rule and delivers emails directly to INBOX. Any idea how to fix that?
[1]: deliver(user@domain.com): Sep 03 23:02:57 Info: Loading modules from directory: /usr/local/lib/dovecot/lda deliver(user@domain.com): Sep 03 23:02:57 Info: Module loaded: /usr/local/lib/dovecot/lda/lib10_quota_plugin.so deliver(user@domain.com): Sep 03 23:02:57 Info: Module loaded: /usr/local/lib/dovecot/lda/lib90_cmusieve_plugin.so
Cheers, Marcin.
perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115), 10);'
!DSPAM:351,46dc7a4820752062134273!
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Mon, 3 Sep 2007, Marcin M. Jessa wrote:
if header :contains ["X-DSPAM-Result:"] "Spam" { ^^^^ First, remove the colon.
Any idea how to fix that?
[1]: deliver(user@domain.com): Sep 03 23:02:57 Info: Loading modules from directory: /usr/local/lib/dovecot/lda deliver(user@domain.com): Sep 03 23:02:57 Info: Module loaded: /usr/local/lib/dovecot/lda/lib10_quota_plugin.so deliver(user@domain.com): Sep 03 23:02:57 Info: Module loaded: /usr/local/lib/dovecot/lda/lib90_cmusieve_plugin.so
Second: In my logs I have a line stating which Sieve script is in use. When you remove the compiled Sieve script, is it re-created by deliver?
Bye,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBRt0UJC9SORjhbDpvAQK5wggArwvezYVpzSVCW3ZLLQx9SnW5DKVzU+/u ZZ+qozhvGrIeAV42Ss1Exq+MLaPHwzKV92ofnzyFkEylHXeKSl0taaP947wQPkQV S8B2ejzJ/nRFKL+AFF5lyNw0DBeyU7bspIPt3VQ0xKsf5RzNhlkFj3JzJrOzPRHV Fj250jg0mQdQrDKrwgsPBpJSUxaaVxTTHBfYzVGAjgWpcC8nKTbdBY99cy/S5LGZ FbvuQEqHdGfjB4YvAYUf6R4Ykgyov3WvTyrP1tXWvNFoplMV/zaglMqZ5m3bp2Kq fqL6IIZspNw7XRKsiMG621mhUtYTAQJheeynSJh9WxcNU2RR3hVuAA== =009T -----END PGP SIGNATURE-----
Steffen Kaiser wrote:
Any idea how to fix that? Second: When you remove the compiled Sieve script, is it re-created by deliver?
I have the same problem with the same config myself. No evidence that the script is being compiled automatically. If I remove the "sieve=path" global setting from dovecot.conf, deliver complains about not finding a per-user sieve or home path - so I assume the sieve module is being activated. Is there a particular format for the global sieve parameter? Does the script file HAVE to be named ".dovecot.sieve"?
-- Daniel A spam trap for your crawler pleasure: listpost@amfes.com
Steffen Kaiser wrote:
Any idea how to fix that? Second: When you remove the compiled Sieve script, is it re-created by deliver?
I have the same problem with the same config myself. No evidence that the script is being compiled automatically. If I remove the "sieve=path" global setting from dovecot.conf, deliver complains about not finding a per-user sieve or home path - so I assume the sieve module is being activated. Is there a particular format for the global sieve parameter? Does the script file HAVE to be named ".dovecot.sieve"?
I've got the global script working. Global setting is there in dovecot.conf. deliver should have write access to that directory, to save compiled script.
It's called .dovecot.sieve, but I don't think it's that important:
require "fileinto";
if header :matches ["X-Spam-Flag"] [ "YES" ] { fileinto "INBOX.Spam"; stop; }
Calling the folder INBOX.Spam is important, if it is to be delivered to users' Spam folders. It doesn't work with '+' delimited address+extension (I reported it in this list, but had no replies).
Regards, Gregory
Gregory Mokhin wrote:
Steffen Kaiser wrote:
Any idea how to fix that?
Second: When you remove the compiled Sieve script, is it re-created by deliver?
I have the same problem with the same config myself. No evidence that the script is being compiled automatically. If I remove the "sieve=path" global setting from dovecot.conf, deliver complains about not finding a per-user sieve or home path - so I assume the sieve module is being activated. Is there a particular format for the global sieve parameter? Does the script file HAVE to be named ".dovecot.sieve"?
I've got the global script working. Global setting is there in dovecot.conf. deliver should have write access to that directory, to save compiled script.
It's called .dovecot.sieve, but I don't think it's that important:
require "fileinto";
if header :matches ["X-Spam-Flag"] [ "YES" ] { fileinto "INBOX.Spam"; stop; }
Calling the folder INBOX.Spam is important, if it is to be delivered to users' Spam folders. It doesn't work with '+' delimited address+extension (I reported it in this list, but had no replies).
Regards, Gregory
What is the format of your global setting? I tried - plugin { sieve = /var/mail/%d/%u }
since my mail dirs are stored under /var/mail/domain/username. Does that search for ".dovecot.sieve" in the specified folder? Or do I need to add that to the path?
Daniel
On Tue, Sep 04, 2007 at 10:34:23AM -0700, Daniel L. Miller wrote:
What is the format of your global setting? I tried - plugin { sieve = /var/mail/%d/%u }
since my mail dirs are stored under /var/mail/domain/username. Does that search for ".dovecot.sieve" in the specified folder? Or do I need to add that to the path?
It's a filename. Either relative to the user's homedir or absolute.
So you should set "sieve = /var/mail/%d/%u/.dovecot.sieve".
Geert
participants (5)
-
Daniel L. Miller
-
Geert Hendrickx
-
Gregory Mokhin
-
Marcin M. Jessa
-
Steffen Kaiser