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 email@example.com as admin in imapd.conf):
sieveshell -a manager -u manager localhost: To edit global scripts.
sieveshell -a firstname.lastname@example.org -u email@example.com localhost: To edit global script of example.com domain.
sieveshell -a firstname.lastname@example.org -u email@example.com 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 firstname.lastname@example.org -a email@example.com localhost
> put /tmp/my_script my_script
cyradm -u firstname.lastname@example.org localhost
localhost.localdomain> mboxcfg email@example.com sieve my_script