Mail Filters
Prev | Cone mail client | Next

## Mail Filters

This is a simple, automatic mail processing function. In this context, “mail filtering” means the ability to move, automatically delete, or automatically flag all messages that match a specific search criteria.

Where possible, it is always more efficient to have the mail server filter messages, instead of a mail client like Cone. Cone mail filters may prove to be sufficient if the mail server does not mail filtering abilities. In situations where the mail server is capable of filtering, the mail server's filters will usually be faster and more efficient.

Mail filters may be used with any IMAP, SMAP, or a local mail account. Mail filters may also be used with POP3 accounts, but they'll be slow, and they'll have certain limitations. Cone will have to download a copy of every message in the POP3 mailbox, in order to check it against the searching criteria, for every mail filter search. This is not needed with IMAP/SMAP accounts, where the search request is processed by the mail server.

Mail filters may also be used in limited ways with Usenet newsgroups. Only limited forms of searching are available: only Usenet message headers may be searched, and the searching criteria may only include English characters. All other search requests can only be met by downloading a copy of every message from the newsgroup, which is not going to work very well, for obvious reasons.

The best use for mail filters with a Usenet newsgroup is as a simple killfile: “Search From: contains troll@example.com”, followed by “Delete and Expunge”.

A mail filter may be installed for any folder. Each folder has its own mail filters. The folder's mail filter is automatically processed by Cone whenever:

- The folder is opened for the first time, or reopened after another folder was opened.

- New messages are added to the folder.

All messages in the folder are processed by the mail filters when the folder is opened. When new messages are added to the folder, only the new messages will be processed by the mail filters. Existing messages will be ignored.

#### Mail Filter Entry Screen

    INBOX - FILTERS                      CONE

      Current Filters:

        Search Subject: contains RFC
        Move to internet-drafts
        Search From: contains boss@domain.com
        Mark
        [ Add new filter ]

        [ Save Filters ]

     ^C Cancel     DEL Delete
     ^D Move down   ^U Move up

This screen is accessed by highlighting a folder on the Folder Listing screen, then pressing F. Each mail filter consists of one or more “steps”. There are two kinds of steps: a “select” step compiles a list of messages that match a certain search criteria; the selection step is followed by one or more steps that apply a particular “action” against all messages that were selected. More than one action step may follow a selection step; messages are processed by each action step in sequence, until another selection step, which searches the remaining messages again, and compiles a different list of selected messages.

Some actions cannot be naturally followed by any other action, and can only be followed by another selection step. Consider, for example, “Delete And Expunge” or “Move to another folder” filtering step: at the conclusion the selected messages are obviously removed, and nothing else can be done with them, any more.

This screen initially shows any existing filtering steps defined for the folder. All filtering steps are processed in the order shown. Highlighting an existing filtering step and pressing CTRL-U, or CTRL-D, moves the filtering step higher or lower, thus changing its relative order in the mail filter. DEL removes the existing filtering step. The folder's mail filter is removed by highlighting each step and pressing DEL, then highlighting “Save Filters” and pressing ENTER.

All changes made on this screen are temporary. “Save Filters” must be selected in order for any changes made on this screen to take effect. CTRL-C closes this screen without changing the folder's existing filter, throwing out all the temporary changes.

Highlighting “Add new filter” and pressing ENTER adds a new filtering step to the end of the mail filter. A sub-menu is shown to define the new filtering step:

S - select

  Enters a new searching criteria which will be used to select messages for the following action steps. See “Search criteria”, below, for more information.

D - mark deleted

  Marks all selected messages as deleted. The messages are not removed from the folder, but only marked as deleted.

U - unmark deleted

  Removes the “deleted” mark from the selected messages. The selected messages are no longer marked as deleted.

X - delete and expunge

  The selected messages are removed from the folder.

R - mark each message as tagged

  Marks, or highlights the selected messages on the folder index screen. Tagged messages are shown as highlighted on the folder index screen, preceded by “`*`”. On some displays, tagged messages are flagged by a checkmark symbol instead of the “`*`”.

K - unmark, or untag the messages

  Removes the highlighting mark from the selected messages.

W - watch thread

  Watch the selected message's replies/subthreads (unless the message is already a part of a watched thread). See “Watching Threads” in the “Folder Index” chapter for more information on thread watching.

A - unwatch thread

  Stops watching the message, and its replies/subthreads.

M - move messages

  Move the selected messages to another folder. Selecting this option reopens the folder index screen. Highlight the folder where the messages can be moved to, and press ENTER.

  ### Note

  Messages can be moved only to folders in the same mail account. Messages cannot be moved to a folder in another mail account.

  This means that this option is not available with POP3 accounts, which naturally have only one folder.

C - copy messages

  Copies the selected messages to another folder. This is very similar to the move command, except copies of the selected messages remain in the original folder.

  ### Note

  This mail filter will be processed every time a folder is opened. Therefore, the selected messages will be copied to another folder every time this folder is opened. This Copy filtering step should be followed by another filtering step, such as Move, or Delete/Expunge, that removes all selected messages. Otherwise the results could be quite amusing

##### Search criteria

A - select all

  Press A to select all available messages.

! - not

  Press ! to logically reverse the following search criteria. Thus, if the entered search criteria was “Search the `From` header for `troll@example.com`” the actual search will find messages where the `From` header does NOT contain this text.

D - search by date

  A date-related search. Additional prompts follow, described below.

S - search by status

  A status-related search. Each message has several status flags that define whether the message is a new message, a deleted message, a replied message, and so on. Selecting a status search shows three options: “Deleted”, “Unread”, and “Replied”, to search for all deleted, unread, or replied messages, respectively.

T - search by text

  A text-based search, search for messages that contain (or don't contain) a given text string. Additional prompts follow, that further refine what kind of text to search for.

Z - search by size

  Search for messages that are bigger or smaller than a certain size. Select “Larger than” or “Smaller than” at the next prompt, then enter the target message size, in bytes, and press ENTER to search.

###### Date-based searches

A date-based search brings up additional prompts that specify the nature of the search. There are two dates that are associated with every message: the “sent” date, when the message was sent; and the “received” date, when the message was received.

The sent date is obtained from the message's `Date:` header. The received date is obtained from the mail server (or from the timestamp on the local mailbox).

The first prompt enters which date is searched for:

1. Messages that were sent before the given date.

2. Messages that were the sent on the given date.

3. Messages that were the sent since (on, or after) the given date.

4. Messages that were received before the given date.

5. Messages that were the received on the given date.

6. Messages that were the received since (on, or after) the given date.

The actual date is entered interactively. It starts with today's date. Press + or - to advance the shown date to the next or the following date. Press [ or ] to advance the shown date by a month. Press < or > to advance the shown date by a month. Press the space bar to accept the shown date, and search for messages.

### Note

Date-based searches are not currently implemented for NetNews newsgroups.

###### Text-based searches

Selecting a text-based search shows a wealth of options:

S - subject

  Search the contents of the `Subject:` header.

F - from

  Search the contents of the `From:` header.

T - to

  Search the contents of the `To:` header.

C - cc

  Search the contents of the `Cc:` header.

B - bcc

  Search the contents of the `Bcc:` header.

H - specific header

  Searches for the given text in some other header. The next prompt asks for the header's name.

O - contents

  Search the contents of the message for the given text.

A - anywhere

  Search the given text anywhere - headers or contents.

Enter the text to search for after selecting one of these options, and press ENTER to perform the search.

### Note

Efficient searching is implemented for local mail, and IMAP/SMAP mailboxes only. NetNews servers' searching capabilities are very limited, and POP3 servers have no search facilities whatsoever. In all cases, searching for message status flags is supported, since message status flags are always cached locally.

Only message headers of NetNews folders may be searched, and only English characters can be used as a search string. Some older NetNews servers may not have any searching ability whatsoever. Searching of message contents is not supported. Searching by message size, or message's date is not supported either.

Searching of POP3 folders is also not very efficient, although the search text is not limited to English characters only. POP3 folder search is accomplished by downloading the complete headers of each message, and searching it manually. Downloaded headers are not cached. The headers are also downloaded when searching by message's date. Searching by message size, or message's date is not supported for POP3 folders.

Prev | Up | Next
Encryption Menu | Home | ToC | Address Book