# Automatic Mail Filtering

This screen enables you to set up basic filtering of incoming messages. An example would be saving all messages from a particular address into a nominated folder. If this is the first time you have used this then on entry the screen will look like:-

## Automatic Mail Filtering

No filter actions defined at the current time

If you have filters in place that have been created either using the Webmail system or using the standard configuration options from the menu interface on __SERVICE__ then when you enter this screen they will be listed, as in the example below.

## Automatic Mail Filtering

1. SENDER: Filter messages from "spammer at spamdomain.com." Remove this filter.

- Store in mail folder: mail/spam

2. SUBJECT: Filter messages with subject of "test". Remove this filter.
   - Store in mail folder:mail/test1

If you have filters created using the advanced configuration option from the menu interface on __SERVICE__ then your filters should continue to be maintained in that way. Consequently the screen will not display the list of existing filters. Instead the following message will be shown:

> Error: Manually maintained .forward file?

## Adding a filter

### The options

It is possible to:-

- Filter on Sender: - actually "Return-Path" rather than the more obvious "From:".
  Note: These two headers frequently have the same value. However mailing lists often alter the Return-Path address to something that is specific to that list. You can find the "Return-Path:" line for a particular message by using Show Hdrs on the message display screen.
- Filter on Recipient: - the contents of the "To" and "Cc" fields of a mail message.
- Filter on Subject: - this option makes a case independent match against the entire subject line. Use wildcards to make a partial match.

Messages are filtered into nominated mail folders other than the Inbox, or a nominated mail folder as well as the Inbox.

### Entering the address or subject

After making the initial choice the address or subject on which you want to filter should be entered. The following wildcards can be used:-

> '?' matches a single character
> '*' matches any number of characters

Hence the following are all valid entries:-

> spammer@spamdomain.com
> *@jiscmail.ac.uk
> ?art?

If an invalid entry is made the status message will provide information. For example if you are filtering by sender address and enter just `Spammer` will result in the status line entry

<tr__STATUS__>
Status: Invalid filter: Not a valid __SERVICE__ account and no domain provided

and the invalid entry will be cleared from the entry field.

### The effect of the Add filter button

When you selecting the Add filter button will present you with a list of your mail folders so that you can select the destination folder.

## Removing a filter

To remove a filter simply select the link Remove this filter by the relevant filter. The status message will change to show which filter was removed, for example

<tr__STATUS__>
Status: Removed filter number: 1

and the filter list will be updated on screen.