r5 - 03 Mar 2005 - 18:05:43 - RdSmithYou are here: TWiki >  TechHelp Web > EmailHelp > EmailManagement

Email Management

Websieve Advanced Options

Websieve allows users who have elected to use the IMAP email protocol, and created destination folders, to filter incoming messages into those folders without cluttering up their 'INBOX'.

Most email clients will automatically establish common folders, such as:

  • Junk
  • Sent
  • Trash

Individual users may wish to establish additional folders, such as '4th-floor' or 'Spam'.

There are two ways to use advanced options in Websieve, Websieve Basic Script Mode, and Websieve Advanced Script Mode. To select either 'basic' or advanced:

image3.jpg
  • In the "Advanced Settings" box. Locate "Script Mode",and click on the radio button for either "basic" (the default setting), or "advanced"

image7.jpg

Option 1 Websieve Basic Script Mode

The easiest way to use custom Sieve scripts is to create a custom rule within basic mode. In our example, we will be placing specific mail into folders.

image3.jpg

  • Click on "Custom Rule (Sieve Script)" and add your script into the text box.
  • The radio button circled in red in the screen shot below shows where this option is located on the New Rule Entry box.

image4.jpg

    • When you are ready to create your own script, you may paste one of the sample scripts below into your favorite text editor and modify it for your particular needs.
    • Then copy the script in your text editor and paste into the text window within the Websieve application.

NOTE: It is highly recommended that you save scripts created "Basic" mode using a script name other than 'Default'. Any changes you make in the Advanced Script mode will automatically overwrite the "Default" script in Basic Script Mode.

  • Once you have entered your script, click on the "Save Changes" button at the top or bottom of the screen.

image6.jpg

The graphic below displays how your rules will look after you have saved them. Let's examine a sample script, line by line.

image2.jpg

  • Rule 1: If the email is tagged with the "{Spam?}" in the header, move it to a folder called Spam.

  • Rule 2: If the email is tagged with the "{Virus?}" in the header, move it to a folder called Trash.

  • Rule 3: If the email is tagged with header called "List-Id" and contains "4th-floor.mailer.csit.fsu.edu", move it to a folder called 4th-Floor.

  • Rule 4: If the email is tagged with header called "List-Id" and contains "seminar announce.mailer.csit.fsu.edu", move it to a folder called 4th-Floor.

  • Rule 5: If the email is tagged with header called "List-Id" and contains "4th-floor.mailer.csit.fsu.edu" or "seminar-announce.mailer.csit.fsu.edu", move it to a folder called 4th-Floor.

NOTE: Rule 5 performs the same function as Rules 3 and 4. It is shown in order to provide an example of how to search for multiple conditions within a rule. In your script, you would want to use Rules 3 and 4 or Rule 5, not both of them. This is shown as an example only.

  • Rule 6: Another example of using two criteria to place email into a folder called Security. This one is a little different because we are seeking different conditions: when the "Sender" contains "sans.org" or when the "Subject" is "Security".

Option 2 Websieve Advanced Script Mode

NOTE: Scripts that you create in the Advanced Script Mode automatically overwrite the Default script used in Basic Script mode.

image3.jpg

  • You can easily create a script by pasting one the examples below into any text editor.
  • Edit as required to customize for your needs.
  • Paste your amended text within the text window within Websieve and click on the "Save Changes" button.

  • Example 1: Moves some messages into folders.

require ["fileinto"];

    if header :contains "Subject" "{Spam?}" {
                fileinto "INBOX.Spam";
    }
    elsif header :contains "Subject" "{Virus?}" {
                fileinto "INBOX.Trash";
    }
    elsif header :contains "Sender" "sans.org" {
                fileinto "INBOX.Security";
    }
Discussion: Note the first line "require ["fileinto"];" -- this allows Sieve to access your INBOX and the folders below. In Option 1, you didn't need to do this because the program takes care of it for you. Your first option always begins with "if" and subsequent options begin with "elsif". If there is something you want to happen if email falls through the "if" and "elsif", you may use an "else" at the end to filter what's left. This was more helpful when you were required to explicitly keep email. However, in the latest release, keep all email that isn't filtered is the default action so "else" is not as important as it once was.

  • Example 2: Forward all your mail to another account.

redirect "my_account@example.edu";

Discussion: The script above acts like a .forward file in UNIX and will forward all your email to another account.

  • Example 3: Vacation

Require ["Vacation"]

vacation "Sorry, I'm out of town until November 23rd. I'll get back to you when I return.";

Discussion: Note the first line, "require ["vacation"];"; you must include this line to use the vacation option within a Sieve script. You have probably already noticed that vacation script is formatted a little differently than the other scripts. Syntax: vacation [:days number] [:addresses string-list] [:subject string] <reason: string> : days ## The number of days to wait before repeating your message to sender (default is 7). : addresses How the email is addressed in the to: or cc: field. Vacation messages are only sent when the email is specifically for the email address identified by :addresses (default: user@csit.fsu.edu). : subject If you want a new subject for your message. Insert the text of your message. Note: when using the basic mode, your email will begin with " CSIT Websieve Auto-generated Message:".

  • Example 4:

require "vacation";

if header :contains "from" "boss@fsu.edu" { redirect "pleeb@xanadu.fsu.us"; } else { vacation "Sorry, I'm away, I'll read your message later."; }

Discussion: Example of different actions based upon "from" field.

Further information can be found at the Sieve home page (http://www.cyrusoft.com/sieve/)

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r5 < r4 < r3 < r2 < r1 | More topic actions
 
SCS TWiki

This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback