Cyrus: 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 as admin in imapd.conf):

  • sieveshell -a manager -u manager localhost: To edit global scripts.
  • sieveshell -a -u localhost: To edit global script of domain.
  • sieveshell -a -u localhost: To edit personal scripts of some user.

Scripts for shared folders work different from user scripts. The last ones are uploaded to the user’s repository and attached to the inbox when you activate them. The first ones must be uploaded 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 -a localhost > put /tmp/my_script my_script cyradm -u localhost localhost.localdomain> mboxcfg sieve my_script

Post to Twitter