Email sieve

From Cncz
Revision as of 00:18, 10 April 2008 by Jverdurm (talk | contribs) (Niet bij de titel e van e-mail in de catefory, want het is al category e-mail)
Jump to navigation Jump to search


If one wants incoming mail to be sorted into folders automatically or to be filtered in some special way, one can use "Sieve" if one has the IMAP-server as incoming mailserver. The Sieve language is described in RFC3028. Below are instructions to activate a Sieve-script:

  • Log in to "" (or "" for students)
  • Type:

and give your password.

  • If you type a '?', you see what to do:
          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

This is an ftp-like interface to view (get) or upload (put) scripts. One has to be a bit careful changing such a script, because it is quite easy to lose new mail this way.

Examples of Sieve-scripts

  • If some mail should be sorted automatically into an existing folder, one can use a script like:

require [ "fileinto", "include" ];
# Messages into folders.
if header :contains "X-VirusscanResult" "infected" {
        fileinto "INBOX.Virus";
include "spam";
include "vacation";

If one wants to redirect all mail that remains after our spamfilter has done its job, one has to add after the include "spam"; line:

redirect "";