next up previous contents index
Next: 5 Reading Messages Up: #tex2html_wrap2538# User's Guide Previous: 3 ML Configuration

4 Filters

4.1 The Filter Editor

 

The Filter Editor allows you to create, modify, delete, attach, and otherwise perform operations on mailbox filters. See "Creating Filters" below for more information on the details of what filters are, how to define them, and what to do with them.

Operations in this window are always performed on the currently selected filter. You select a filter by highlighting it (single click) from the filter list (the bottom section of the window).

  figure693
Figure 4.1: The Filters Window 

If you wish to create a new filter, first start off by clearing any current selection with Reset. Only when there is no current selection will you be allowed to Add a filter (located in the File menu). Adding a filter will also make it the current selection. Once a filter is selected, you will be allowed to perform other operations, such as to modify, delete it, or attach it to the mailbox.

Modifying a filter will update any currently attached filters of the same name, UNLESS the name was also changed. The name is the only identifying information available to track through the list of attached filters to locate those which were derived from the present filter. Other editing operations have no effect on filters which are already attached.

For example, if you delete a filter from your collection, any running instances of that filter will continue to run, unless they are Detached from the Virtual Mailbox Window. Closing a mailbox will also detach any views associated with that mailbox. The Virtual Mailbox Window works in conjunction with the Filter Editor to manage your filters.

4.2 Creating Filters

 

Filters allow you to select specific messages or groups of messages. These are defined by a filter definition which you type into the Filter Definition box.

First, each filter must have a Filter Name. This is the name you will use when accessing it. Names may contain anything but spaces, which will automatically be turned into dash "-" characters.

You may or may not wish to associate a Default Action script with the filter. If you aren't sure at this point, leave it blank. You can come back and change it at any time. Actions are described in other Help files.

You may also select a default sort mode for this filter. The four sort types are described in detail under the Help file for the Main Window. (The window containing the list of messages).

Finally, each filter must have a filter definition, or "rule". This is described in Help->On Filters from the menu which brought you here.

There are four distinct ways you may "attach" a filter to a mailbox. These are defined by the Apply buttons. You may apply the filter to either the current mailbox, or the current "view", which could be a mailbox or it may be yet another filter. It is whatever is showing in the Main Window that brought you here. (Each main window has a number, which is reflected in the Virtual Mailboxes window also). You may also apply a filter as "dormant" or "active". A dormant filter is a "one-time search" and will not be updated often, if ever. An "active" filter is always updated when changes are made to the mailbox it is attached to. You may save active filters to be automatically applied when you open a particular mailbox (from the Virtual Mailbox Window).

Active filters each take a small amount of time to process whenever things in the mailbox change, and this time adds up for each filter processed. The time this takes is also affected by the complexity of the associated filter definition. Therefore one should be judicious in selecting which filters are activated continuously.

Attaching filters only to the current view may be used to improve performance, since only those messages in the view a filter is attached to need to be examined when the mailbox changes. This also implies that filters may nest to arbitrary depths; with each level of filter becoming more and more selective.

Any limits to filter depth are based on the fact that any information stored to your preferences or saved layout files is restricted to 8192 bytes per line. This, in theory, should be adequate for most uses, but is mentioned here in case it turns out that it isn't.

4.3 Filters Rules

 

4.3.1 General Information

Any search criteria which contains spaces must be enclosed in double quotes, for example:

	SENDER "John Smith" AND SUBJECT "meeting today"

Capitalization is irrelevant in filter rules.

	SENDER "JOHN SMITH"

and

	sender "John Smith"

are considered identical. Messages which fit all of the filter criteria (i.e. all criteria return "true") will become "members" of the resulting message collection.

4.3.2 Operator Precedence

     

Filters are evaluated strictly left to right in terms of operations such as AND and OR. There is no means of altering this flow.

The NOT operator has precedence over AND and OR. It applies only to a single rule to its immediate right, and is applied before any other AND or OR operations involving that rule.

Subject to these constraints, any number of operations may be logically chained together. See also "Logical Operators" near the end of this document.

4.3.3 Examples of Filter Rules

 

	from john and not deleted

Selects all messages from "john" which are NOT flagged as deleted. Note that using the built-in operator UNDELETED is slightly more efficient than using NOT DELETED, which results in two distinct operations, whereas UNDELETED is a single search.

	since lastsaturday and before monday

Selects all the message which arrived over the most recent weekend.

	RECIPIENT "talklist@podunk.edu"

Selects all the messages which are sent to this particular mailing list, regardless of whether the mailing list was addressed in the "To:" or the "Cc:" field of the message.

	FROM linda OR SUBJECT "wind surf"

Selects all messages which are either from linda or which contain the consecutive words "wind surf" in the "Subject:" line.

4.3.4 Filters and International character sets

 

International characters (those not in the US-ASCII character set) may only be applied to the SUBJECT search method. In all other cases, if the message was encoded for transport, the search applies only to the encoded values. The "Subject:" line is made available in your native character set, if possible, and this may be searched using international (i.e. accented) characters. All other information which was encoded for transport, is only decoded for viewing and local file operations (printing is considered a local file operation).

When using international addresses in filters, it is therefore often more useful to specify the machine address "user@host", which is always in flat US-ASCII, rather than the personal name which may have been encoded.

If possible, search rules should be defined which make use of a sequence of characters of interest which are known to lie completely within the US-ASCII character set, if such a sequence can be used to adequately describe the search.

For those unwilling to accept this as an absolute, it should be possible to enter a search for the ENCODED value of the information. A detailed description of the encoding methods is provided in the Internet documents RFC-1521 and RFC-1522. Future versions of this software may not be restricted by this rule.

4.3.5 Recognized Words

 

TO, FROM, CC, RECIPIENT, CORRESPONDENT, CONVERSANT, SUBJECT, MESSAGE-ID,
SENDER, REPLY-TO, IN-REPLY-TO, RETURN-PATH, REMAILED, >, HEADER, BODY,
TEXT, AND, OR, NOT, KEYWORD, SINCE, BEFORE, ON, NEW, OLD, DELETED,
UNDELETED, SEEN, UNSEEN, RECENT, ANSWERED, UNANSWERED, FLAGGED,
UNFLAGGED, TODAY, YESTERDAY, THISMONTH, LASTMONTH, SUNDAY...SATURDAY,
LASTSUNDAY...LASTSATURDAY, JANUARY...DECEMBER

Search Tokens for Message Header

 

Search Tokens for Message Data

Note: The following three text searches should be used very sparingly, and preferably only with "one-shot" filters. Depending on the size of your mailbox, it may take several seconds, (and possibly several minutes) to perform these searches. If they are defined in a filter for continuous updating, the search will be applied every time there is a change in the mailbox. This could potentially result in long delays.

Message States

   

Time Formats

 

Notes: Dates are defined as starting and ending at midnight. A date may be a specific date in the format DD-Mon-YY, i.e. "12-Mar-94", or may be one of the dynamically defined dates described below. These dates are re-evaluated whenever a change is made to the mailbox. Weeks are defined as starting at midnight on Saturday/Sunday.

Dynamic Dates

 

The following may be used in any date specification and will be re-defined whenever the filter is evaluated.

Logical Operators

 

Operator Chaining

 

As long as you keep in mind the rules of operator precedence, you can construct arbitrarily long filter definitions.

Example:

	from "george" or from "tom" and since monday and not deleted

If this were grouped using symbolic notation to show the precedence rules in effect, the result would look like:

	((((from "george") or (from "tom")) and	(since monday)) and (not (deleted)))

4.4 Filter Actions

  The Action field shows up in two places.

  1. The Main Mailbox Window
  2. The Filter Editor

Think of actions as a script to minimize doing the same things over and over again; especially when you have defined and attached a filter or two, and the resulting collection of messages is almost always handled in the same way.

The action you enter into a filter editing form defines the default actions to be applied to that particular filter, and is saved along with the filter definition. Every filter you create may have its own unique set of actions associated with it. The Action field from the Main Mailbox windows displays for you what the default action is for the current mailbox or filtered view, and it also allows you to dynamically change this action script without affecting the default.

Actions are carried out by either clicking the Action button, or pressing [return] from within the Action text area.

An action is a series of commands which you would normally carry out using the keyboard or mouse. You may chain several operations together and perform them all with a single click.

4.4.1 First some caveats (warnings)

Not all actions or combinations of actions make sense. Take some time to plan them out. For instance, if you perform an action which selects everything and copies the selections to a mailbox, if the messages aren't at some point removed from the view, they will be copied again the next time you invoke the action. If your action is

	UNSELECT ; PRINT
nothing will be printed, because nothing will be selected. Also note that an EXPUNGE (equivalent to the "Destroy" button in the Main Window), is irreversible, and removes all messages in the currently selected mailbox which have the DELETED flag set. It is not limited to the messages in a particular filtered view.

In the following descriptions, "[]" indicates a required parameter, and "{}" indicates an optional parameter.

4.4.2 Action Reference Guide

Headers

For actions which accept a header option, you may choose between:

4.4.3 Chaining actions

  You may chain any number of actions together. A semicolon is used to separate each action. The final action does not require a semicolon. As described earlier, some combinations of actions are unrealistic, such as:

	unselect; print

...Since there are no messages selected, there will be nothing to print.

4.4.4 Examples

 

  1. Highlight all messages in this view, delete them, and then remove them from the mailbox
    	select; delete; expunge
  2. Assuming several messages are already highlighted, save them to an "urgent" mailbox; move the rest to a "junk" mailbox, then remove all of them from this mailbox.
    	move urgent.mail; expunge; select; move junk.mail; expunge
  3. Flag all currently selected messages as "interesting".
    	flag
  4. Print the highlighted messages, without a header, and mark them for deletion. Unhighlight them when you're done.
    	print noheader; delete; unselect
  5. Highlight all new messages, queue them for reading, and then unhighlight them.
    	new; read; unselect

next up previous contents index
Next: 5 Reading Messages Up: #tex2html_wrap2538# User's Guide Previous: 3 ML Configuration

SIMOND Gilles
Wed Jan 24 13:31:26 MET 1996