Matthias Kellermann
2007-Nov-26 13:50 UTC
[Dovecot] Using global und per-user sieve scripts at the same time
Hi list, I'm trying to get a global sieve mailfilter with per-user sieve scripts to work. At the "lda"-section in the dovecot.conf file I have: global_script_path = /usr/local/etc/sieve/spam /usr/local/etc/sieve/spam: require "fileinto"; if header :contains ["Subject"] ["***Spam***"] { fileinto "Spam"; stop; } which will work fine delivering Spam Mails in a Spam dir for every user. If a user creates his own .dovecot.sieve file the global script will not work anymore. How can I enable global and local per-user sieve scripts at once? Is this possible? Do you know any workaround so all users will have the same (Spam-)sieve filters beside there own (global templates or so)? Matthias
Nikolay Shopik
2007-Nov-26 13:51 UTC
[Dovecot] Using global und per-user sieve scripts at the same time
On 26.11.2007 16:50, Matthias Kellermann wrote:> Hi list, > > I'm trying to get a global sieve mailfilter with per-user sieve scripts > to work. > > At the "lda"-section in the dovecot.conf file I have: > global_script_path = /usr/local/etc/sieve/spam > > /usr/local/etc/sieve/spam: > require "fileinto"; > > if header :contains ["Subject"] ["***Spam***"] { > fileinto "Spam"; > stop; > } > > which will work fine delivering Spam Mails in a Spam dir for every user. > If a user creates his own .dovecot.sieve file the global script will not > work anymore. > > How can I enable global and local per-user sieve scripts at once? Is > this possible? Do you know any workaround so all users will have the > same (Spam-)sieve filters beside there own (global templates or so)? > > Matthias >You forgot to insert this one, where users sieve files stored. plugin { sieve = /var/mail/store/%u/sieve }
Timo Sirainen
2007-Nov-26 14:17 UTC
[Dovecot] Using global und per-user sieve scripts at the same time
On Mon, 2007-11-26 at 14:50 +0100, Matthias Kellermann wrote:> If a user creates his own .dovecot.sieve file the global script will not > work anymore. > > How can I enable global and local per-user sieve scripts at once? Is > this possible?Unfortunately not. Sieve plugin v1.1 (requires Dovecot v1.1) supports include extension, so in per-user scripts they could include the global script. It should probably be somewhat easy to do this including automatically. (Actually I'm hoping to offload Sieve development to Stephan Bosch and his completely rewritten Sieve code. I don't know when it's going to be in a usable state though. And I hope the code's existence wasn't a secret.. :) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20071126/05a13b66/attachment-0002.bin>
Matthias Kellermann
2007-Nov-26 15:55 UTC
[Dovecot] Using global und per-user sieve scripts at the same time
Timo Sirainen schrieb:> On Mon, 2007-11-26 at 14:50 +0100, Matthias Kellermann wrote: >> If a user creates his own .dovecot.sieve file the global script will not >> work anymore. >> >> How can I enable global and local per-user sieve scripts at once? Is >> this possible? > > Unfortunately not. Sieve plugin v1.1 (requires Dovecot v1.1) supports > include extension, so in per-user scripts they could include the global > script. It should probably be somewhat easy to do this including > automatically.It's Dovecot 1.07 on FreeBSD. So there is no include option. So I will write a little script which will copy a template sieve file in each users home directory on/after creation.> (Actually I'm hoping to offload Sieve development to Stephan Bosch and > his completely rewritten Sieve code. I don't know when it's going to be > in a usable state though. And I hope the code's existence wasn't a > secret.. :)Is that sieve implementation better than the current one (fork of Cyrus sieve implementation if I remember correctly)? Matthias
Mark E. Mallett
2007-Nov-27 13:19 UTC
[Dovecot] Using global und per-user sieve scripts at the same time
On Mon, Nov 26, 2007 at 04:17:43PM +0200, Timo Sirainen wrote:> On Mon, 2007-11-26 at 14:50 +0100, Matthias Kellermann wrote: > > If a user creates his own .dovecot.sieve file the global script will not > > work anymore. > > > > How can I enable global and local per-user sieve scripts at once? Is > > this possible? > > Unfortunately not. Sieve plugin v1.1 (requires Dovecot v1.1) supports > include extension, so in per-user scripts they could include the global > script. It should probably be somewhat easy to do this including > automatically. > > (Actually I'm hoping to offload Sieve development to Stephan Bosch and > his completely rewritten Sieve code. I don't know when it's going to be > in a usable state though. And I hope the code's existence wasn't a > secret.. :)That is cool... more implementations are better. FWIW I've liberated (as in, made into a library) my own language implementation (which includes Sieve as a subset, but can be used at runtime as Sieve-only and could probably be made Sieve-only at compile time). This is an effort I did to help make the language implementation more standalone and easier to work on. Currently it's only in a private area but will likely be used (and thus be availble) in the next (approximately year-end) release of the package of programs that use this language. It would be interesting to have some kind of standard API for Sieve libraries, but I do wonder how feasible that would be. mm