Global Sieve scripts?
Ana Ribas/Upcnet
ana.ribas at upcnet.es
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 active-filter.sh
INITIAL=`echo $1 | cut -c1`
NAME=`echo $1 | cut -f1 -d'.'`
LASTNAME=`echo $1 | cut -f2 -d'.'`
FULLNAME=`echo $NAME"^"$LASTNAME`
cd /var/sieve/$INITIAL/
mkdir $FULLNAME
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 lists.andrew.cmu.edu
info-cyrus-bounce cc
s at lists.andrew.cm
u.edu Subject
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: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
More information about the Info-cyrus
mailing list