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 at domain.com): Sep 03 23:02:57 Info: Loading modules from directory: /usr/local/lib/dovecot/lda deliver(user at domain.com): Sep 03 23:02:57 Info: Module loaded: /usr/local/lib/dovecot/lda/lib10_quota_plugin.so deliver(user at 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);'
-----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 at domain.com): Sep 03 23:02:57 Info: Loading modules from > directory: /usr/local/lib/dovecot/lda > deliver(user at domain.com): Sep 03 23:02:57 Info: Module > loaded: /usr/local/lib/dovecot/lda/lib10_quota_plugin.so > deliver(user at domain.com): Sep 03 23:02:57 Info: Module > loaded: /usr/local/lib/dovecot/lda/lib90_cmusieve_plugin.soSecond: 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 at 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).Actually I managed to fix this setting global_script_path = /usr/local/etc/sieve/Junk instead of sieve_global_dir The emails marked as spam were moved to correct directory which is Junk, as listed in user's subscriptions file and not INBOX.Junk. I also correcred my sieve file to say: 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; } But now I can see following logs for some of the accounts. Any idea what that may be? This account is not above quota which is set to 51200000 (just to be sure). deliver(lists at yazzy.org): Sep 04 18:04:16 Info: sieve runtime error: Keep: Generic Error deliver(lists at yazzy.org): Sep 04 18:04:16 Error: sieve_execute_bytecode(/usr/local/etc/sieve/Junkc) failed deliver(lists at yazzy.org): Sep 04 18:04:16 Info: msgid=<200709042006.51319.flash at preferance.ru>: Rejected: Quota exceeded Some work fine: deliver(abc at def.com): Sep 04 19:08:34 Info: msgid=<s6dd58a7.055 at xyz.abc.state.ga.us>: saved mail to Junk deliver(abc at def.org): Sep 04 19:13:37 Info: msgid=<9B1E9600-42CC-49E0-8CB8-AF826257EE1B at abc.no>: saved mail to INBOX Cheers, Marcin P.S Becouse of that error I sent the same message twice yesterday and did not receive any follow ups so I had to copy and paste this thread from the web archive.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, 4 Sep 2007, Marcin Michal Jessa wrote: The naming of the Sieve script and the configuration variables is explained here: http://wiki.dovecot.org/LDA/Sieve Note: The change of the name of global script path. "script path" refers to a filename, not just the directory of the ".dovecot-sieve" file. BTW: Because the script is compiled into a byte code representation, everybody needs write permission to the directory of the script (creates .tmp file, on success renames into <<script path>>c ). If you force the compilation process using "sievec", no write permission is required, e.g.: scriptpath=<<absolute filename/path of your Sieve script>> /usr/local/libexec/dovecot/sievec $scriptpath ${scriptpath}c Bye, - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQEVAwUBRt5UJC9SORjhbDpvAQKhDgf9G88Cfz02N/oZmvTsgB7mAIhnO1B36Bou hM1toYuPS0Om95b6N3AjPBjlFizYPaQrJLApwXLWGnqPr4vLZmX3vJ71Lc0w4VUr CkpDKMlrL3ip6Z0v1w7MqsIcFK1PInCZ+qFDA9IHGlNWMMOiTxTKai0Uj+0zIv2c GeIo3zL6KoBirXs+WiAw2EN/0jJCq6W/yV/+DECyOTJEhwigcMliGI46pIAv2l6i a6r8sIbQB4y7d3eoei/M+DkPYH9emuKPIxB7RDEAdKN1WDyPe4S7JPFEYghiQzLd qY4pcU/y+UbnWEyQHQAhkWoonFyW9rgACtCe4OOcwgZsKqz81xkkWQ==kPwA -----END PGP SIGNATURE-----
On Wed, 5 Sep 2007 09:00:49 +0200 (CEST), Steffen Kaiser <skdovecot at smail.inf.fh-bonn-rhein-sieg.de> wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Tue, 4 Sep 2007, Marcin Michal Jessa wrote: > > The naming of the Sieve script and the configuration variables is > explained here: > > http://wiki.dovecot.org/LDA/Sieve > > Note: The change of the name of global script path. > > "script path" refers to a filename, not just the directory of the > ".dovecot-sieve" file. > > BTW: Because the script is compiled into a byte code representation, > everybody needs write permission to the directory of the script (creates > .tmp file, on success renames into <<script path>>c ). > If you force the compilation process using "sievec", no write permission > is required, e.g.: > > scriptpath=<<absolute filename/path of your Sieve script>> > /usr/local/libexec/dovecot/sievec $scriptpath ${scriptpath}cI just ran a test defining sieve_global_dir = /usr/local/etc/sieve/ in my dovecot.conf and commenting global_script_path Then I renamed my sieve script to .dovecot-sieve in that dir. And nothing happened. It was not compiled and used. I had to define global_script_path = again and then I could as well give the script a more reasonable name like Junk since it takes care of filtering of junk mail. Any idea why it does not work as you say? BTW, http://wiki.dovecot.org/LDA/Sieve should have things mentioned for global users as well since I overlooked that part from "Per-user Sieve script location" thinking it did not consider users of global scripts. Marcin.