Example Sieve Scripts for CAL

CAL E-mail filtering is handled through Sieve. You can find out more about how to set up a new sieve script here. This page documents some example sieve scripts that people at CAL find useful.

CAL default

The default sieve script can be found here. It filters all detected viruses and spam into the subfolder called spam in your inbox. If you have no such folder, all mail will be delivered to your inbox.

~/.forward emulation

If you want to have your CAL E-mail forwarded to another e-mail address without keeping it on your astro account (the functionality that was previously handled by ~/.forward files), you can create and import a Sieve script that contains the line:

redirect "user@domain.com";

forwarding only non-spam e-mails

This is similar to the default CAL script, but instead of delivering non-spam e-mail, it redirects it to an external address:

require "fileinto";

if header :is [ "X-DSPAM-Result", "X-DSPAM-Reclassified" ] [ "Spam", "Virus" ] {
	fileinto "INBOX.spam";
	stop;
}
redirect "user@domain.com";

Note that if you use this, you should probably check your CAL spam box from time to time to purge the real spam and retrain your filter on anything that was missed.

Vacation script

This script can be used to auto-respond to email with a message (like the old vacation utility). You will need to change the email address to match your own, and modify the text of the message to fit your own needs. Any given email address will only get one 'Out of the Office' message every seven days.

require "fileinto";
require "vacation";

if header :is [ "X-DSPAM-Result", "X-DSPAM-Reclassified" ] [ "Spam", "Virus" ] {
        fileinto "INBOX.spam";
        stop;
}

vacation :days 7 :addresses "changetoyourusername@astro.columbia.edu"
              :subject "Away from my email"
"I will be away from my email until xxx.";

To use it, create a file called myvacation.script containing this text on pluto or some shell server (make sure you first use 'kinit' to authenticate to kerberos), then type

sieveshell mail
put myvacation.script 
activate myvacation
quit

When you get back, you can revert to the default script with:

sieveshell mail
activate cal-default
quit

other examples

You can find some example sieve scripts online, if you want to experiment more.