Understanding the rules.MailRules Document

January 31, 2004 - One of the more powerful and interesting new features in FirstClass 7.1 is the rules.MailRules document. This document, in it's default version, provides a prescan of incoming internet mail and adds or modifies various headers (technically RFC-822) in the Internet Header part of a message. This document is in the Filters folder inside Internet Services on your server.

These modified headers can then be used by individual user Mail Rules to sort, file, redirect or delete messages according to the users choices.

The default rules.MailRules document as provided by FirstClass provides a basic starting point, it rejects messages from sites listed in the filters files and a few other special conditions. An admnistrator who understands the way the document was written can modify it to reject mail as they see fit. In FirstClass 7.1, it only works on the information in the Internet Header (addressing, subject, from address, IP numbers, etc.) and not the message body. FirstClass 8 will be able to work on the message body too.

A casual look at the mail.MailRules document may cause you to think it is undecipherable, the language used is not easily understood without some background. The various lines are written using GREP (global regular expression printer) which comes from UNIX. It is frequently used in PERL programming.

GREP is a pattern matching command intended to allow searching for text strings within a file. FirstClass uses the same pattern matching in rules.MailRules to search for particular information, then take some action if the pattern is matched.

Start with the Unix manual pages for GREP. You can find these on the Internet by entering "man grep" in a search engine. You can also enter "man grep" at a UNIX command prompt such as in the Terminal program of OS X. These pages are your reference so for training next search for "grep tutorial" in your search engine. You will find many references with specific examples. Here is a site with valuable introductory information:


Next, you will want to understand how FirstClass uses the GREP search pattern format in the rules.MailRules document. For instance, the GREP command itself is not used in the document. Instead, the GREP parameters are used in an IF

[GREP parameter] line. An excellent discussion of how the default document works is available on the FirstClass website at: http://www.firstclass.com/CentrinityPerspectives/Terry_Whyte/ISMailRules

You will find by studying this page that the formerly hard coded JUNK determination capabilities of FirstClass Server have been moved into rules.MailRules along with a number of new conditions that are checked.

When a matching condition is found in a message header, a new X-FC tag and value is added or incremented or an NDN can be returned to the sender. At the end of processing, the total is added up, and depending on the total value, a new icon (circle with a red, yellow, or green icon) is added to the normal envelope postmark icon and the word JUNK: may be added to the Subject Line of the message in your mailbox. User can then use these rankings in their Mailbox mail rules.

For a discussion of rules.MailRules, there are two conferences on FirstClass Online that are of interest. Administrators ask for suggestions for items they are trying to block and frequently someone will send back the exact text to enter. Look in Advanced Connections at Desktop > Conferences > Product Discussions > Advanced Connections and FCO Intranet Server at Desktop > FirstClass Online > Technical Discussions > FCO Intranet Server. This last conference is available by request only. See the message at: http://www.acornus.com/currentnews/012604.html to see how to get access.

FCNews Service © 2004-2009 Acorn MicroSolutions Inc.
FirstClass logos and original content © 2004 Open Text Corporation