Global Sieve scripts?

Ana Ribas/Upcnet ana.ribas at
Mon Mar 27 05:08:04 EST 2006

This example works for me.

I use "unixhierarchysep: yes" in my /etc/imapd.conf

The sieve filter moves a spam message to the Spam folder.
I have the script /usr/lib/cyrus-imapd/scripts/spam-sieve.script.
This is the code:

      require ["fileinto"];

      if header :contains "Subject" "[SPAM]"
              fileinto "Spam";

Now I compile the script:

> /usr/lib/cyrus-imapd/sievec spam-sieve.script spam-sieve.bc
> chmod 600 spam-sieve.*
> chown cyrus:mail spam-sieve.*

I active this filter everytime I create a mailbox:

> more
INITIAL=`echo $1 | cut -c1`
NAME=`echo $1 | cut -f1 -d'.'`
LASTNAME=`echo $1 | cut -f2 -d'.'`
cd /var/sieve/$INITIAL/
chown cyrus:mail $FULLNAME
cd /var/sieve/$INITIAL/$FULLNAME/
ln -s /usr/lib/cyrus-imapd/scripts/spam-sieve.bc defaultbc
echo "Activated defaultbc filter to $FULLNAME"

 I hope that this helps you.

- ANNA -

             Anders Norrbring                                              
             <lists at norrbring.                                             
             se>                                                        To 
             Sent by:                  info-cyrus at     
             info-cyrus-bounce                                          cc 
             s at                                             
                                       Global Sieve scripts?               
             26/03/2006 17:04                                              

This may be the wrong list to ask in, if so, please point me to the
right one.

I'm wondering if there's a way to have a "global" sieve script that
takes some action on ALL the hosted e-mail addresses on the system?

Anders Norrbring
Cyrus Home Page:
Cyrus Wiki/FAQ:
List Archives/Info:

More information about the Info-cyrus mailing list