The Polarbar Mailer filters are accessed via the option on the Tools menu of the program's main window. The Inbound Mail Filters dialog lets you create, modify, delete, and rearrange filters. Filters are executed during each mail retrieval in the order in which they appear in this dialog. If you want to move a filter's position in the execution order, select it and press the Up or Down button until it is located where you want it.
The On/Off button turns a filter off or on. You can turn a filter off any time you want to prevent it from executing without deleting it permanently. You can also turn a filter on or off, make any other change to it, or just view its settings, by selecting it and pressing the Details button.
Always use the Save button to leave this dialog if you want any changes you've made to be kept. Cancel will close the dialog without saving your changes.
To create a filter, press the New button. This brings up the Create New Filter dialog where you specify the new filter's name and the type of filter you want it to be: Regular, List, or Java (see below). Then press the Next> button to continue with the following dialog which is appropriate to the type you've specified. The next dialog shows the filter's name at the top and an ON or OFF button which shows you the filter's current state. This button toggles it to the opposite state if you press it. At the bottom are the fields where you can specify what you want the filter to do if it finds a match between the message and what it's looking for.
Regular filters
Specify what part of the message you want the filter to search (for example, the From line, the To line, the Subject line, the entire set of message Headers, the message Body, All Text (both headers and body), and various other choices.) Then specify whether you want that message part to contain the search string, to not contain it, to start with it, end with it, etc. You can even select exists which means you don't specify a search string, but the filter action is activated if the specified message part is present at all. Then (if you haven't specified exists there) you type the search string which can be a word, a part of a word, or multiple words. You can make the search case sensitive by turning off the Ignore case checkbox. On the second line, you may choose AND, OR, or XOR from the leftmost dropdown and, if you do, you can also specify the same four types of information for a second search string in a second portion of the message.
For example, you might build a filter which performs some action if the Body of the message contains the string hello or HELLO, AND the Subject ends with on Sale.
List filters
Specify where you want the message to search. If you select Message body contains any combination of the strings or Any header contains any combination of the strings, then the entry field to the right will be enabled to let you specify how many matches should be required in order to activate the filter. For example, if you say 3 and the message contains only 1 or 2 of your specified search strings, the filter will not be activated; if the message contains 3 or more, then it will. Or you can specify Received header contains any of the domains, From or Reply-To contains any of the domains, Any header contains any of the domains, From or Reply-To contains any of the user names, To, Cc, or Bcc contains any of the user names, or Any header contains any of the user names. These search criteria really do not differentiate between domains, user names, or any other type of string in any particular location. These options are named this way not because they do differentiate such things, but only to make it more obvious what the options might be used for. The search string will be found in the specified header line regardless of whether it's a domain name, a user name, etc.
Then you specify the list of strings for which you want the filter to search. The list can be one entry long or hundreds. If you have hundreds of entries, you probably have them in an ASCII text file, one entry per line, which you can import into the list box without typing them manually by selecting the Import list from a file button on the right.
Java filters
You can write a Java class which will perform the work you want the filter to do or you can write a Java class which will only return true or false and let the filter perform one or more of its own actions when the return is true. Sample.java and Sample.class files are provided along with the Polarbar Mailer package. This class takes a string as an argument, searches the Subject: header of the message for that string, and returns true if the string is found.
To create a Java filter, select your class file and optionally specify any arguments with which it should be called. Of course, the class file must reside in a directory which is on your class path in order for the program to be able to execute it.
Filter actions
For each filter, you can specify up to four actions. Each of the possible actions requires different additional information in order to do what it's supposed to do. The middle and right hand fields are activated or not depending on which action you select on the left.
When you use nicknames (which can be for persons or groups) with a filter action that involves sending an email message, then when you press the OK button, the nicknames are validated. If any of the nicknames cannot be resolved, then you have the option of either using the bad nickname anyway or returning to the email address field to correct the nickname. Nicknames used in filters are always saved as nicknames. When the email filter action is executed, any nicknames will be resolved when the message is set up to be sent. If a nickname fails to resolve at that point, the email filter action will not be executed and an error message with the subject 'Error in filter "{filter name}"' will be placed in your INBOX, with the following contents:
An error occurred in mail filter "{filter name}" when attempting to {filter action} message "{message subject}". The specified nickname ({address(es)}) was not found in your address book.