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