Introduction
Basics about the Filter rules
Building and Enabling a Filter rule
Building and Enabling more than one Filter rule
Advanced Matching Conditions
Some Examples Explained
Filtering when you use Email Vacation autoreply, Email Forwarding and Tagged Spam Filtering
Email delivery filtering is often known as server-side filtering. You define rules to screen your incoming email messages to assist in sorting and organizing your e-mail, most notably:
Since this happens during mail delivery (on the server-side), your email program does not need to download thus saving you connection time, download time, and your time to manage the messages such as filing to folders. You can access the folders from the IT IMAP server with an email program such as with IT Webmail.
The downside is you have to poll your folders for new arrivals and misfiled messages. Once enabled, all your incoming mail is subject to the rules.
The following describes the structure of filter rules and then takes you through the basics of setting up server-side filtering rules.
The fundamental structure is:
if (condition) then action
Filter rules have two parts: conditions and actions.
The three types of conditions correspond to asking the questions:
Actions include save, savecopy, forward, forwardc, delete
save - Store the message in another folder: the folders are created on the IT IMAP server
savecopy - Store a copy of the message in another folder: as above but a copy is also placed in your INBOX.
Use simple names for your folders but you can build complexity in your folder structure keeping in mind the following rules:
You access your mail folders with Thunderbird, Outlook Express, Apple Mail (and other email programs) or with IT Webmail.
forward - Send the message to another email address
forwardc - Send a copy of the message to another email address and keep a copy for yourself: as above but a copy is also placed in your INBOX.
delete -Delete the message: Message is "discarded" permanently. There would be no way to retrieve it without asking the sender to resend it.
if (from = "myprof@ucalgary.ca") then savecopy Fromprof if (to = "mylist-l@mailman.ucalgary.ca") then save LISTS/mylist if (sender ~ /@mailman\.ucalgary\.ca/) then save LISTS/othermailman if (lines > 1000000) then save Mail/bigmail always forwardc myhome@telus.net
To start, point your web browser at the IT Filter Utility. Enter your IT username and password in the appropriate boxes and press the "Go" button.
Begin your first rule:
if ( subject = "Test Filter" ) then save testfilter
If the rule is syntactically correct then a green "Enabled" status would be displayed. If any errors in syntax are encountered the rule is labelled with "Error:" and the rule is not activated. Correct any errors in the rule:
If the rule is a subject match then you could test that rule immediately by sending an email with that subject. Otherwise if based on from address then you will have to monitor your email for the results.
The filtering process works like an assembly line. When you receive an email message the system starts at the beginning of the list of rules. For each rule in turn, it checks to see if the condition is satisfied by the message. If it isn't, it hands the message on to the next rule. If it is, though, it performs the action and stops processing. If the system gets to the end of the rule list without stopping processing, it delivers the message in your inbox.
Create or add a new rule by typing in the text box, one per line. The changes are inactive until you click the associated "Update filter rules" button. To begin with you may want to add one rule at a time, activate it then to make sure you have typed the rule correctly before adding additional rules. Or you can set up one or more rules and not put them into effect until everything is precisely right. Then check the checkbox Enable Filtering and click "Update filter rules" button. Rules that are flagged Error: are not active. Other rules will be active.
Correct each rule one by one until no errors occur and status of "Enabled" is shown.
However, you can check for a pattern or patterns matching any header at all by using a * by itself in the header text box.
Please also note that the regular expression type of match does not automatically include * characters at the beginning and end of the pattern. This allows you to match for things occurring only at the beginning or end of a header (by only putting a * at the end or beginning of the pattern, respectively), but to look for a wildcard expression in the middle of a header you should put * characters at both the beginning and end.
Check if the message size is or is not above or below some value: If you just put a number in the size box, it specifies a number of characters in the message (both header and body). You can put a "K" after the number to specify kilobytes (1024 bytes) or an "M" to specify megabytes (1024 kilobytes, or 1048576 bytes).
There are a number of ways you can do this; they all use header match conditions:
if (subject contains "[NHL]") then save NHLscores if (sender ~ /@mailman\.ucalgary
\.ca/ then save LISTS/othermailman if (to = "mylist-l@mailman.ucalgary.ca") then
save LISTS/mymailmanlist
remember, in this case, matching either the to or cc header the condition is true
Match expression = or contains are interchangeable. The ~ character indicates regular expression matching and the pattern is enclosed in slashes.
Note the folder directory LISTS would already have to exist by creating it with an e-mail program. You can simply create folders without a folder directory depending on how you want to organize your e-mail, for example LISTS:othermailman is simply the name of a folder.
You would do this by setting up a rule with a header match condition
if ( from = "drjones@ubc.ca") forwardc bsmith@ucalgary.ca
Note the use of matching based on the From address line.
This function has been implemented with the Tagged Spam IT Utility ready for you to enable it. Once Enabled, Spam tagged messages will be filed to spam-mail folder (or deleted) prior to any other filtering including importantly your vacation autoreply or forwarding. The spam-mail folder will also be cleaned according to your choice of how long you want to keep the messages.
Please note the following points in the management of your incoming e-mail: