|
|
Setting Up Delivery Rules
You can use delivery rules to direct incoming mail to particular mailboxes based on the contents of To, From, Sender, Subject, the entire message Header (everything but the body of the message), or the Body of the message. Delivery rules can be applied at three levels:
Delivery rules can be used in conjunction with the Info Manager to screen for a particular phrase, and then (if the phrase is found) send an automatic response and forward the mail to someone for follow-up.
Examples
- A delivery rule for a host. A school administrator can set up a delivery rule that scans all mail for offensive language and delivers such messages to a special user account that can be reviewed by a faculty member.
- A delivery rule for a list-server mailing list. A system administrator can set up a delivery rule for a list-server mailing list to scan the body of all messages addressed to the list for language that indicates that the mail came from a spammer or bulk mailer, and ignore any such messages. For example, the rule can search for one of these text strings:
- to be removed from any future mailings
- please respond with the word "remove" in the subject line
- advertise with bulk e-mail
- bulk friendly
- A delivery rule for an individual user. You could set up a rule for a sporting goods salesman to have all messages with baseball, softball, bat, base, homerun, or cap in the Subject be automatically placed in his mailbox named baseball.
- A delivery rule combined with the Info Manager. You could set up a delivery rule to forward all mail containing the phrase "send info" to a particular mailbox named Requests in a user account named Sales. Then, you could set up the Info Manager to send out a generic response and also forward the mail to your company's Sales Manager. (For more information about the Info Manager, see "Using the Info Manager".)
Rules Processing
IMail Server stores delivery rules in text files named rules.ima. If the rules apply to a host, the file is stored in the host directory. If the rule applies to a list-server mailing list, the file is stored in the list's directory. If the rules apply to an individual user, the file is stored in the user's directory. For information on the order in which rules files are processed, see "Processing Order".
Any rules.ima file can be copied to other directories; for example, if you create delivery rules for one user, you can copy the rules.ima file to the directories of other users to apply the same rules to them. For more information, see "Applying User Settings to Other Users".
Delivery rules created by the system administrator for an individual user affect only mail sent to the user's Main mailbox.
Note that users can use Web Messaging to create their own delivery rules by selecting "Change Processing Rules" on the Menu page of Web Messaging. However, rules created by a system administrator for a domain will take precedence over rules for a particular user, as described in "Processing Order".
Creating a Delivery Rule
The following procedure describes the creation of a delivery rule.
- In the left panel, do one of the following:
- To create a delivery rule for a mail host, select the host.
- To create a delivery rule for a user, expand a host and the "Users" folder, and then select a user.
- To create a delivery rule for a list-server mailing list, expand a host and the "Lists" folder, and then select a list.
- In the right panel, click the Rules tab. Click the Add button. You see the following dialog box.
![]()
- Leave the "Rules tab..." selected, and click ADD. The Rules tab now looks like this:
A placeholder is placed in the Active Rules list just under the selected slot (if any). The rule is temporarily named New Rule. The default text in the "contains" box is [Search text here]. The default mailbox is Main.
You cannot name delivery rules, because they are identified in the Active Rules list only by their sequence in the list. To identify a delivery rule, you highlight one of the rules (e.g., rule1, rule2) and read its contents in the search text box.
- Next to "If the," select the area that you want to search (From, To, Subject, Sender, Body Text, or Header Text).
- Select the contains option to have the delivery rule look for messages that contain the search string; select doesn't contain to look for messages that do not contain the search string.
- Replace the default search text by doing one or more of the following:
- Enter the literal text that you want to search for. For example, if you want to find the word jazz, type: jazz
- Type search expressions and quantifiers as shown in the Text Patterns table on page 83.
- Use the popup menu to insert a generic form of a search expression and then edit the inserted expression.
- Paste a portion of a mail message that meets your intended search criteria. For instance, you could copy and paste text such as XMSMailPriority(High) from the header of a message; this would search for High priority messages.
- Turn on Match Case to search for text that matches the case of the search string; to ignore case, turn off Match Case.
- Do one of the following:
- If this rule is for a user, in the "send to the mailbox" box, enter the name of the mailbox to which messages meeting the rule criteria will be sent. If you enter a mailbox that doesn't exist, one will be created for this user on the IMail Server system. A POP3 user will see this mailbox only if he logs on to this mailbox using the format userid-newbox. Enter NUL to discard the message.
- If this rule is for a list, in the "send to the list" box, enter the name of the list to which messages meeting the rule criteria will be sent. Enter NUL to discard the message.
- If this rule is for a host, in the "send to the mailbox" box, enter the user ID to which messages meeting the rule criteria will be sent. If you want the message to go to a particular mailbox, follow the user ID with a hyphen and mailbox name, such as ffarkle-news@company1.com. Enter NUL to discard the message. If you enter a mailbox that doesn't exist, one will be created for the specified user account on the IMail Server system. A POP3 user will see this mailbox only if he logs on to this mailbox using the format userid-newbox.
- Click Apply to save the rule.
When the screen is refreshed, the delivery rule, previously identified as New Rule, will appear in the format Rule# to identify its sequence in the Active Rules list. Any existing delivery rules are renamed to reflect the new sequence.
Order of Rules
Delivery rules are processed from the top down until a match is found. Therefore, you should sequence the rules in the order in which you want them processed. To move a delivery rule up or down in the list, select it and click the Move up or Move down buttons to the right of the list. For more information about processing order, see "Processing Order".
Testing a Delivery Rule
- Select the rule in the Active Rules list.
- Click the Test button. The "Rule Tester" dialog box appears.
- In the Test Text box, enter a message that meets your intended search criteria.
- Click the Test button in the upper right.
If the delivery rule does what you set it to do, TRUE is displayed in the Test Result box and the cursor ends up at point where the True condition was met.
If the delivery rule doesn't test true, FALSE is displayed in the Test Result box and the cursor ends up at point where the False condition was met. Edit the rule and test again. For a long or complex rule, we recommend you test one part of the rule at a time.
- Click OK to save the rule.
Note: You cannot discard changes; if you make an error, delete the saved rule and start over.
Rule Syntax
When you create a delivery rule, the rule is entered into a file named rules.ima in the following format:
message_area condition search_text quantifier : mailbox_name
Note that search_text can be any combination of literal text and the text patterns on page 83.
For example, a rule that looks like this in the dialog box:
![]()
... will search the message body for the words word1 or word2 or word3; if at least one of the words is found, the message will be delivered to the words123 mailbox.
The above rule looks like this in the rules.ima file:
![]()
The expressions for each element of a delivery rule are shown in the following tables.
Message Areas
Message Area Representation From: F Subject: S Sender: N To: T entire header (everything preceding the body) H entire body of message B
Conditions
Condition Expression contains ~ does not contain !~ equals = does not equal !=
Quantifiers
Quantifier Expression Zero or more * One or more + Exactly 100 {100} At least n1, but not more than n2 (where n1 and n2 are numbers) {n1,n2} Note: As shown above, the following characters have special meaning in a rule: {}()|*+,.:\ If you want to use one of these characters in a search string, precede it with a backslash. For example, to search for a plus sign, enter \+ in the search string.
Storing Search Text in External Files
If you want to frequently update and disseminate the search text for delivery rules, you can use external text files to store the search text. Then, all you have to do is distribute the text file. The external text file must have a file extension of .rul.
For example, the administrator can use this method to catch mail from known spammers. The administrator might create a text file named spam.rul. Each time a new spammer address is discovered, the administrator can add it to the spam.rul file. The rules.ima file can reference the text file named spam.rul. To send spam messages to a mailbox named spambox, the rules.ima file would contain the line:
h~:spam:spamboxNote that the .rul file name is preceded by a colon. The IMail server reads the rules.ima file and looks for the referenced spam.rul file at the same location as the rules.ima file.
To create a delivery rule that references an external text file,
- Start IMail Administrator if it is not currently running. In the left panel, do one of the following:
- To create a delivery rule for a virtual host, select the host.
- To create a delivery rule for a user, expand a mail host and "Users" folder, and then select a user.
- To create a delivery rule for a list-server mailing list, expand a mail host and "Lists" folder, then select a list.
- In the right panel, click the Rules tab. Click the Add button.
- In the Create New Rule dialog box, do the following:
- Select External text file.
- If the external text file already exists, select the file. For example, select :rulefilename where rulefilename is the name of the .rul file you want to reference.
- If the external text file doesn't exist, enter a new, unique name for the .rul file. Do not enter the file extension rul as IMail Server will append it to whatever you enter.
- Click OK.
- Next to "If the" select the area that you want to search (From, To, Subject, Sender, Body text, or Header text).
- Select the contains option to have the delivery rule look for messages that contain the search string; select doesn't contain to look for messages that do not contain the search string.
- Turn on Match Case to search for text that matches the case of the search string; to ignore case, turn off Match Case.
- Do one of the following:
- If this rule is for a user, in the "send to the mailbox" box, enter the name of the user's mailbox to which messages meeting the rule criteria will be sent. If you enter a mailbox that doesn't exist, one will be created for this user on the IMail Server system. A POP3 user will see this mailbox only if he logs on to this mailbox using the format userid-newbox. You can also enter NUL to discard the message.
- If this rule is for a list, in the "send to the list" box, enter the name of the list to which messages meeting the rule criteria will be sent. Enter NUL to discard the message.
- If this rule is for a host, in the "send to the mailbox" box, enter the user ID to which messages meeting the rule criteria will be sent. If you want the message to go to a particular mailbox, follow the user ID with a hyphen and the mailbox name, such as ffarkle-news@company1.com.
If you enter a mailbox that doesn't exist, one will be created for this user on the IMail Server system. A POP3 user will see this mailbox only if he logs on to this mailbox using the format userid-newbox.
- Click Apply to save the rule.
- Open the .rul file in a text editor and see the "Rule Syntax" section above to create the search text.
Note that when you view a delivery rule that references an external file, the text box has a grey background to indicate that you can't edit the search text on the Rules tab. To edit the search text, click Test Rule to open a dialog box in which you can make edits.
Limitations
Each delivery rule is limited to 5000 characters.
Delivery rules search the first 32,000 bytes of a message. If a message contains fewer than 32,000 text characters plus attachments, the delivery rule will scan the attachment as though it is text. In rare cases, but particularly when the search text is only a few characters, a delivery rule could find something in an attachment that looks like a match, but isn't.
|
Ipswitch, Inc. http://www.ipswitch.com |
| ©Ipswitch 2001 | |||