Oregon State University

Modifying your email filters using sieveshell

 

If you need to modify your Sieve email filters by hand rather than using the tools on the ONID web site, see the instructions below.

ONID email filtering rules use the Sieve language, which was designed specifically for email filtering. The Sieve language is formally defined in RFC 3028. There are many example Sieve filters that you can use as a starting point to learning the Sieve language. You can also look at the rules created by the tools on the ONID web site.

To begin, you'll need to SSH? to shell.onid.oregonstate.edu. Then execute sieveshell, specify the ONID mail server, and authenticate with your ONID password:

username@shell:~$ sieveshell imap.onid.oregonstate.edu
connecting to imap.onid.oregonstate.edu
Please enter your password: 
>

At the "> " prompt, you can type "help" to see a list of available commands:

> help
Usage:
  sieveshell [-u username] [-a authname] [-r realm] <server>

help             - this screen
list             - list scripts on server
put <filename> [<target name>]
                 - upload script to server
get <name> [<filename>]
                 - get script. if no filename display to stdout
delete <name>    - delete script.
activate <name>  - set a script as the active script
deactivate       - deactivate all scripts
quit             - quit

Use the "list" command to view the Sieve scripts you have stored on the server, as well as which script is active.

> list
onid-web  <- active script

To save a script out into a file so that you can edit it, use the "get" command.

> get onid-web sieve.txt

After you have edited sieve.txt, use the "put" command to upload it.

> put sieve.txt onid-web

Note: If your Sieve script had errors in it, sieveshell will tell you the errors and not allow you upload the script.

The final step is marking your script as active, using the "activate" command.

> activate onid-web

Use the "quit" command to exit sieveshell when you are finished making changes.

Contact Info

Copyright ©  2014 Oregon State University
Disclaimer