[Dovecot] hwo can i have managesieve protocol and cmusieve plugin work at the same time
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hello everybody,
I would like to use managesieve protocol and cmusieve plugin at the same time.
I have used the cmusieve plugin for years and I now also enabled the managesieve system. I got the managesieve system working but when I activate the managesieve filter for the user the cmusieve sieve filter is not used anymore.
How can I have both sieve systems working, the cmusieve is for a global all user spam filter, and the managesieve is for one user only. I don't want the user to have control over the spam sieve filter, because other systems depend on the location where spam is archived.
Below are my configurations:
root@ashley:~# cat /etc/dovecot/dovecot.conf protocols = imap imaps managesieve mail_location = maildir:/home/vmail/%d/%n
ssl_cert_file = /etc/tls/powercraft.nl/powercraft.nl-certificate.pem ssl_key_file = /etc/tls/powercraft.nl/powercraft.nl-privatekey.pem
protocol lda { auth_socket_path = /var/run/dovecot/auth-master postmaster_address = postmaster@powercraft.nl # hostname = ashley mail_plugins = cmusieve global_script_path = /home/vmail/system/scripts/sieve/x-spam-flag.sieve }
protocol managesieve { # Specify an alternative address:port the daemon must listen on # (default: *:2000) #listen = localhost:2000
# sieve=~/.dovecot.sieve sieve_storage=/home/vmail/sieve/%d/%n }
auth default { mechanisms = plain passdb sql { args = /etc/dovecot/dovecot-sql.conf } userdb static { args = uid=5000 gid=5000 home=/home/vmail/%d/%n } socket listen { master { path = /var/run/dovecot/auth-master mode = 0600 user = vmail } client { path = /var/spool/postfix/private/auth mode = 0660 user = postfix group = postfix } } }
cat /home/vmail/system/scripts/sieve/x-spam-flag.sieve require "fileinto"; if header :contains ["X-Spam-Flag"] ["YES"] { fileinto "archive.spam"; }
root@ashley:~# ls -hal /home/vmail/powercraft.nl/jelledejong/.dovecot.sieve* lrwxrwxrwx 1 vmail vmail 75 2009-03-08 12:07 /home/vmail/powercraft.nl/jelledejong/.dovecot.sieve -> /home/vmail/sieve/powercraft.nl/jelledejong/jelledejong.powercraft.nl.sieve
- -rw------- 1 vmail vmail 688 2009-03-08 13:54 /home/vmail/powercraft.nl/jelledejong/.dovecot.sievec
root@ashley:~# cat /home/vmail/sieve/powercraft.nl/jelledejong/jelledejong.powercraft.nl.sieve require "fileinto";
if header :contains ["List-Id"] ["debian-devel.lists.debian.org"] { fileinto "mailinglists.debian-devel"; }
if header :contains ["List-Id"] ["debian-mentors.lists.debian.org"] { fileinto "mailinglists.debian-mentors"; }
if header :contains ["List-Id"] ["debian-embedded.lists.debian.org"] { fileinto "mailinglists.debian-embedded"; }
if header :contains ["List-Id"] ["dovecot.dovecot.org"] { fileinto "mailinglists.dovecot"; }
if header :contains ["X-Mailing-List"] ["linux-usb@vger.kernel.org"] { fileinto "mailinglists.linux-usb"; }
Somebody that know how to have both sieve filters systems working?
Best regards,
Jelle de Jong -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux)
iJwEAQECAAYFAkmzwr8ACgkQ1WclBW9j5Hn6wwQAlNWgpMQSjOm6mEErjd4CoOVQ gapOO74IC3zc3oJKLpA8cmxhzZs3RtRCuCruyuyAX5CMhvM41EE78jYUVhmkx7Br IDKHGSiex4qjkuJ9O6fDrLwETaDrFHrgQ8i2EkPtMjB+/B7T/3CR7ZzGc4gXKL+J GCTqaIor9y3efy672ic= =hPIn -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hello everybody,
I would like to use managesieve protocol and cmusieve plugin at the same time.
I have used the cmusieve plugin for years and I now also enabled the managesieve system. I got the managesieve system working but when I activate the managesieve filter for the user the cmusieve sieve filter is not used anymore. Yes, that is difficult for Dovecot v1.1 and there is no real good workaround. The Sieve implementation for Dovecot v1.2 does have support for executing multiple Sieve scripts sequentially, making it possible to
Jelle de Jong wrote: truly force execution of the administrator's script before the user's script.
How can I have both sieve systems working, the cmusieve is for a global all user spam filter, and the managesieve is for one user only. I don't want the user to have control over the spam sieve filter, because other systems depend on the location where spam is archived.
As a workaround, one may think it is possible to have your global x-spam-flag.sieve include the user's sieve script with the include extension. This will work, however, the CMUSieve plugin requires any included Sieve script to exist. A nasty side effect of this is that any user who deactivates his Sieve script through ManageSieve ends up deleting the link to it on the server. This will break the include from the global Sieve script and end its execution.
I am not sure whether there is a proper workaround to achieve something like this for Dovecot versions prior to v1.2. Can't think of any...
Regards,
Stephan
Stephan Bosch wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hello everybody,
I would like to use managesieve protocol and cmusieve plugin at the same time.
I have used the cmusieve plugin for years and I now also enabled the managesieve system. I got the managesieve system working but when I activate the managesieve filter for the user the cmusieve sieve filter is not used anymore. Yes, that is difficult for Dovecot v1.1 and there is no real good workaround. The Sieve implementation for Dovecot v1.2 does have support for executing multiple Sieve scripts sequentially, making it possible to
Jelle de Jong wrote: truly force execution of the administrator's script before the user's script.
How can I have both sieve systems working, the cmusieve is for a global all user spam filter, and the managesieve is for one user only. I don't want the user to have control over the spam sieve filter, because other systems depend on the location where spam is archived.
As a workaround, one may think it is possible to have your global x-spam-flag.sieve include the user's sieve script with the include extension. This will work, however, the CMUSieve plugin requires any included Sieve script to exist. A nasty side effect of this is that any user who deactivates his Sieve script through ManageSieve ends up deleting the link to it on the server. This will break the include from the global Sieve script and end its execution.
I am not sure whether there is a proper workaround to achieve something like this for Dovecot versions prior to v1.2. Can't think of any...
Regards,
Stephan
Hi Stephan, thank you for your work, I own you a beer!
I can wait a bit more for the cmusieve plugin to work next to managesieve protocol, is there a bug report that I can subscribe to so I know when it will work? Is it a planned feature for the next release? It was just a bid unexpected that activating a users managesieve filter will break the excising global cmusieve plugin.
Thanks in advance,
Jelle de Jong
Jelle de Jong wrote:
Hi Stephan, thank you for your work, I own you a beer! Hehe, looks like we share a country, so I may take you up on that offer :)
I can wait a bit more for the cmusieve plugin to work next to managesieve protocol, is there a bug report that I can subscribe to so I know when it will work? Is it a planned feature for the next release? It was just a bid unexpected that activating a users managesieve filter will break the excising global cmusieve plugin.
Well, the main problem is not that CMUSieve and ManageSieve don't work together. Keep in mind that ManageSieve uses the CMUSieve plugin to perform the actual execution of the script, so these are not conflicting in any way. Rather, CMUSieve does not support executing the global Sieve script and the personal user script sequentially: currently these are mutually exclusive.
The new Sieve plugin for Dovecot v1.2 supports this using the sieve_before setting:
http://hg.rename-it.nl/dovecot-libsieve/file/tip/INSTALL
So, for Dovecot v1.2 this is already fixed (still needs to be tested more though). Implementing this for Dovecot v1.0/v1.1 with CMUSieve requires significant changes and I don't think it is worth doing so, because CMUSieve is being replaced with the new implementation for Dovecot v1.2. Therefore, I think 'waiting' will mean waiting until you are prepared to use v1.2 (e.g. when it is deemed to be stable).
Regards,
Stephan Bosch
participants (2)
-
Jelle de Jong
-
Stephan Bosch