Global sieve script possible?

Christian Rößler Roessler at FuH-E.de
Wed Sep 23 16:54:27 CEST 2009


Gunnar Wrobel schrieb:

>> in the way of preparing a migration to Kolab I am wondering if it is
>> possible to use a global sieve script, which will be executed before
>> user's sieve scripts?
>> I was not able to find much in the net (eg. for example
>> <http://lists.andrew.cmu.edu/pipermail/cyrus-devel/2007-January/000239.html>)
>> or in the Kolab documentation. So I would be thankful if anyone could
>> hint me whether this is possible, and if so, how.
>> Or would it suffice to put a (compiled, of course) sieve script into
>> /kolab/var/imapd/sieve/global?
> Hm, I had that question before and I think it does not work at the
> moment but it should be possible to get it to work.

Just for the record, as I have repeatedly found this mail doing internet
research (and perhaps it helps others, it would have saved me time at
least):

I think the only possibility presently to have a global is using the
'include'-directive. So, for Kolab (let's say the User is called 'kro'):

1. Enter the user's sieve directory:
cd /kolab/var/imapd/sieve/domain/x/x.your.domain.tld/k/kro

2. Edit your default-sieve-Script for that user (do not forget to
'require' include), no need to use filename.bc:
bash-3.2$ vi default
require "fileinto";
require "...your other requires...";
require "include";
include :global "default";

3. 'compile' it to bytecode:
bash-3.2$ sievec default default.bc

4. Change to global, edit, compile global sieve script:
cd /kolab/var/imapd/sieve/global/
vi default
(do your sieve-ing...)
bash-3.2$ sievec default default.bc

That's all. The deficiency of this method is that 1. this include has to
be in every user's defualt sieve script, and 2. user could edit their
sieve scripts to not execute the 'global' sieve script. So I would very
much like a truly global solution - but for now this suffices.

Best regards, Christian




More information about the users mailing list