Page Contents

Creating Filters

You can create a new filter in a number of ways, some of which specify initial settings for the new filter.

The easiest is to make a filter directly from an article that you want to highlight, or to kill (remove from the list in future). Either open the article, or select it in the list of articles for a group. Then choose one of the Filter this... or Kill this... items from the Filters menu. These are also available on the context menu in the Subject window. If you want to filter to apply to a more general set of groups, choose a target group from the Create Filter for submenu of the Filters menu.

When you've chosen to make a new filter, or to edit an existing one, you'll see the following dialog.

The filters dialog

In this case, the filter is matching the regular expression "News *Watcher" (this matches "NewsWatcher", "News Watcher" etc.), and highlighting resulting articles with red text on a green background.

The Filter Dialog

This dialog box contains three panels, between which you can navigate using the tabs at the top of the dialog. The first panel, Matching & Actions, specifies the specifies the matching criterion for this filter and its action, i.e., what happens to articles that are matched by this filter.

The second panel, Advanced Options, allows you to specify whether the filter will expire, to control the section of the group hierarchy to which the filter applies (i.e., its scope), and various other options.

The third panel, Article Effects, contains settings that can make special things happen to articles that are matched by the filter.

These various options are described in more detail in the following sections.

Filter Matching & Action

The first panel of the Filter dialog contains settings that control which articles are matched by the filter, and what happens to matched articles. The contents of this panel change, depending on whether you are filtering on a text-based headers, or on the lines or dates header.

Filter actions

The main actions of this filter are specified in the top section of the dialog box. These actions affect the status of the article (killed, highlighted etc), whether it is highlighted with color, and the assignment of a priority to the article.

The first popup menu determines the action of this filter on matched articles: Highlight, Keep and Kill.

Highlight

Matching articles are colored in the Subject window, using the colors specified in the two color swatches in this dialog.

"Highlight" filters color the subject or author text of matching articles in the main subject window, to draw attention to such articles.

You can choose foreground and background colors by clicking in the swatches of color in the dialog; a palette of colors will pop up, from which you can choose a color. The palette also contains some empty swatches at the bottom, and an "Other..." option that allows you to choose a color from the color picker. Colors chosen in this way then appear in the empty swatches, so that you can easily get at them again.

You can also change the colors in the body of the palette by holding down the Option key when choosing a color. This again shows the color picker, and the color you choose then replaces the color in the palette at that location.

Keep

Matching articles are not colored, but are simply kept in the list. This is useful if you are set a group to delete unmatched filters (discussed in the previous chapter).

Kill

Matching articles are killed, which means that they are marked as read by the software before you ever see them. This is useful to remove those really annoying "Make money fast" posts, and other articles that you don't want to see.

Killed articles usually are not displayed, and so coloring them does not make much sense. But you may make use of the "Show killed articles" option in the Preferences, and perhaps assign light colors so that such articles are visible, but not prominent in the list.

Filtering on Different Types of Headers

The second popup menu specifies which header to search in for the text: the author, subject, organization, etc. You will probably use filters based on Subject most often, but it can also be useful to search other fields. Beware that the choice of field here can lead to significantly longer downloading times. If you choose "Lines" or "Date" from this popup, then the controls in the dialog will change to let you set lines and date filtering options (see below).

Note: Some news servers refuse to provide some of the information that MT-NewsWatcher needs to filter on certain headers. More specifically, they don't index those headers. For example, this is common for the Newsgroups header. If you find that a filter isn't working, this may be the reason. For each news server that does this, MT-NewsWatcher will warn you once about each header that isn't available.

Filtering on Text Headers

For matching text headers like Author, Subject, References and so on, different types of text match are available, in the next popup across that shows "matches the regular expression" in the picture. These are:

  • Contains
  • Does not contain
  • Starts with
  • Ends with
  • Is
  • Is not
  • Contains the word
  • Contains a word beginning
  • Contains a word ending
  • Matches the Regular Expression
  • Does not match the Regular Expression
  • Message is Junk
  • Message is Not Junk

Most of these matching types should be self-explanatory, and work in a similar way to the "Find" commands of many word processors. Near the bottom are two matching types are based on Regular Expressions, which are a concise (and rather obtuse) means of matching strings using certain syntactical rules. See the page on Regular Expressions for more detail. The last two options, relating to junk messages, make this filter a Junk Message filter.

Type the word or phrase you want to the filter to match (or not match) in the text field. You can enter up to 255 characters in this field. If you want the matching to be case sensitive, then select the checkbox.

Filtering by Lines

MT-NewsWatcher offers some sophisticated filtering based on the length, and date of articles. If you choose to filter by line counts, you see this panel in the Filter dialog box:

The lines filter controls

and can specify to match articles longer, shorter, exactly, or not exactly the given number of lines. The "Less than" and "More than" comparisons are mutually exclusive; "Less than 2 lines" means that articles with 1 or fewer lines will be matched. Number of lines here means the number of lines of text in the article, excluding header lines.

Filtering by Dates

Filtering by date provides two options: relative and absolute date matching. Relative date matching filters articles according to some age relative to the present, for example you can match articles older or younger than 2 days:

The relative date filter controls

When you use the "Exactly" and "Not exactly" comparisons to match dates, the outcome is dependent on the date measure (days, weeks, etc.) that you use. If you create a filter to highlight articles that are exactly 2 days old, MT-NewsWatcher subtracts two days from the current date and selects articles that were posted on that day. If you filter by a number of months, then articles posted during the relevant month will be selected.

Alternatively, you can specify an absolute date to show articles posted before or after a particular date:

The absolute date filter controls

In this case the match is done to a resolution of one day, and all articles posted on the specified day will be selected.

Using Filter Scores

Using filters to highlight articles with colors, or to kill unwanted articles, gives you control over what set of articles you see. Finer control over the prioritization of articles is possible through the use of scores.

A score is an arbitrary value that a filter assigns to each article that it matches. As articles are filtered, they accumulate their own score, which is simply the sum of the scores of applied filters. Article scores can then be used to sort articles in subject windows, or for killing articles.

Scoring articles

A set of predefined scores is available through the "Score" popup menu, in the Filter dialog box, ranging from Lowest (with a score of -10) to Highest (with a score of 100). Choosing a filter priority from this popup menu automatically assigns the corresponding score. The filter priority has no other function than to assign a score.

Filters score popup

You can edit the score manually, simply by typing a value in the box beside the priority popup menu. If the score you typed in matches one of the predefined priorities, then the popup menu is updated to reflect this.

Filter scores can range from -32767 to 32767. Negative scores cause articles to be sorted lower in the list, and higher values sort them towards the top. Unfiltered articles have a score of 0 (zero), so you should use negative scores for those articles you want to assign an even lower priority.

You can show the final scores that articles end up with by checking the "Show scores" checkbox in the "Subject windows" preferences panel. This will display an extra column in subject windows with that score, as well as showing filter scores in the Filters window. This should provide enough information for you to verify that your scoring scheme is working as intended.

Killing by score

For more control over killing articles, you can specify that those under a certain score are killed. To activate this function, check the relevant checkbox in the "Filtering options" preferences panel, and supply the threshold score below which you wish to kill articles. For example, a threshold of 0 (zero) will kill all articles whose cumulative score is less than zero, while keeping unmatched articles with a score equal to 0.

Advanced Options

This panel contains some additional options that allow you to modify the behavior of this filter.

The Advanced filter panel

Target Groups

In this text field enter the part of the group hierarchy you want the filter to apply to. This must be a valid part of the group hierarchy, i.e., if you want the filter to apply to more than one group, the "*" must be at the end. This is not a substring of the group name.

Tip: You can also drag filters around in the Filters window to move them between groups. If you want to make a copy of a filter in another group, hold down the Option key and drag.

Expiring filters

Filters can be set to "expire" after a certain length of time, which means that they become inactive, and are then deleted from your filters file. Expiring filters are useful for killing threads that you don't want to read any more, but which are not a permanent problem.

If you edit a filter again some time after creation, and want to extend its life by another period of time, you can choose that period by typing a number into the box, and choosing the "From now" radio button. Then the expiration date is recalculated as the present, plus the time interval specified.

The three expiration options are:

From creation date

The filter will expire after the length of time you specify has elapsed, since the creation date of the filter. This is the default option.

From now

Select this option to extend the life of the filter by the specified time period.

From last use

This option allows you to have "self-expiring" filters, which will expire and disappear when they are no longer matching articles. Each filter contains the date when it was last used (i.e., when it last matched an article). Upon creation, this last used date is set to the creation date of the filter. If a filter is no longer matching articles, once its "last used" date is older than the specified time period, the filter will expire.

Filters with expiry dates are shown with a small 'watch' on the icon: Icon for an expiring filter

Although the expiration time is saved to the nearest second, filters are only actually expired when you start up MT-NewsWatcher. On startup, if a filter has passed its expiration date (somewhat like a "best before" date), then it is loaded for this session but shown with a red 'watch' on the icon: Icon for an expired filter. When you quit this session, this filter will not be saved to the filters file, so if you want to keep it, you will have to edit it and change the expiry date.

To warn you that certain filters have expired, you can set a preference to have MT-NewsWatcher put up a dialog on startup that says how many filters have expired. This behavior is controlled by a checkbox in the "Filtering options" preferences panel, which is labelled as Notify when filters expire.

Filter Options

In the lower half of this panel there are some other controls to prevent this filter being overriden by others, as well as to temporarily disable this filter. Overriding is described below.

Disable this filter

This option is useful to "turn off" a filter temporarily without actually deleting it. For example, you might want to do this if the filter requires that extra headers be downloaded from the server and you are on a slow connection so can't tolerate this extra time.

Tip: You can disable a filter without going through this dialog by Option-double-clicking filters in the Filters window.

Don't override this filter

Filters are applied to articles in the order in which they appear in the Filters window, from the global filters (in the '*' group) to the group-specific ones, and in order within each group category. However, some articles may be matched by more than one filter.

For example, you might have a global filter that kills articles with "cash" in the subject line, but a group-specific filter that highlights articles with "Power Mac" in the subject. Both of these will match an article with the subject "Good cash wanted for Power Mac").

Normally, the last (most specific) filter applied is the one which decides whether the article is highlighted or killed. However, you can ensure that a filter which is not the last to be applied is not overridden by checking the "Don't override this filter" checkbox. In the above example, the article would then be killed by the first filter.

Note: The final score of an article is the cumulative score assigned by all the filters that match the article. If an article is matched by a "Don't override" filter, score accumulation stops with that filter.

Article Effects

This panel contains a couple of controls that affect articles that are matched by the filter. They allow you to fine-tune article text encoding conversion, as well as the personality that is used to reply to matched articles.

The Article Effects filters panel
Decode matching articles as

When you open articles matched by the filter, MT-NewsWatcher will assume that they were sent with this character set, and decode them appropriately. This is useful to "fix" the decoding of articles that are sent with missing or incorrect character set information.

Reply to matched articles as

When you reply to an article which has been matched by the filter, MT-NewsWatcher will use the Personality specified here, instead of the default or the one specified in Group Settings. This can be useful if you want to always use a specific personality, say to represent you as your work self when replying to certain articles which mentioning the name of your product.

Using Regular Expressions

Read on to find out how to use Regular Expressions in your filters.

Table of Contents