From Cyrus
Cyrus Sieve
Cyrus Sieve
Cyrus Sieve is an implementation of the Sieve mail filtering language (RFC 3028).
Mail filtering occurs on delivery of the message (within lmtpd).
Cyrus 2.2 compiles sieve scripts to bytecode to reduce the overhead of parsing the scripts fully inside of lmtpd.
Sieve scripts can be placed either by the timsieved daemon (implementing the ManageSieve protocol, this is the prefered options since it allows for syntax checking) or in the user's home directory as a .sieve file.
Sieve scripts in shared folders
Attaching a sieve script to a shared folder is a little tricky. First, you need to understand that Cyrus has two types of repositories where you can have Sieve scripts: Personal and Global. Personal is per user and global is for every user. Global scripts aren’t applied on incoming messages by default, users must include them in their scripts.
Also, there are two types of Global scripts: global and global per domain.
When you log into Cyrus IMAP with sieveshell you have the following combinations (I suppose that you have manager and manager@example.com as admin in imapd.conf):
- siveshell -a manager -u manager localhost: To edit global scripts.
- sieveshell -a manager@example.com -u manager@example.com localhost: To edit global script of example.com domain.
- sieveshell -a user@example.com -u user@example.com localhost: To edit personal scripts of some user.
Scripts for shared folders work different from user scripts. The last ones are loaded to the user’s repository and attached to the inbox when you activate them. The first ones must be loaded to the global domain repository and attached to a shared folder by an user that has permission on it. You have to use the second combination of the listed above to load them and cyradm (or another compatible client) to do the attach:
sieveshell -u manager@example.com -a manager@example.com localhost > put /tmp/my_script my_script cyradm -u user@example.com localhost localhost.localdomain> mboxcfg shared.folder@example.com sieve my_script