Determining Which Rule Trapped a Message

If a message is trapped by a rule, an X- IMail-Rule line is placed in the message header to allow you to know which rule caught the message. If multiple rules trap a message, only the first rule will be placed in the X line in the header. The X-IMail-Rule line will also contain up to 30 characters of the message data that caused the message to be trapped. Message data will not be included in the X-IMail- Rule line when a message is trapped by a negative rule (does not contain or does not equal).

If a domain rule traps the message, the X-IMail-Rule header will be added to all local deliveries. If a message is trapped by a user's rule, the X-IMail-Rule header will only be added to deliveries to the user. When a message that is destined for local delivery is trapped by an outbound rule, a line with the rule causing the trap will be written to the Queue file. When this message is delivered, and that line exists in the Queue file, it will be written as an X-IMail-Rule line in the message header. Outbound messages that are not delivered locally, will not have an X-IMail-Rule line in the header.

Example X-IMail-Rule line:

X-IMail-Rule: S~ Company Newsletter: Newsletter-Monthly Company Newsletter

Rule Section

Explanation

S

If the Subject of the message

~

Contains

Company Newsletter

Rule Text

:

send to

Newsletter

Name of the mailbox to send the message to

- Monthly Company Newsletter

Message text that caused the message to be trapped.

Disabling the X-IMail-Rule Header

If you want to disable the X-IMail-Rule header, so that it does not appear in the message header, you must add an entry to the registry. In the registry, go to HKEY_LOCAL_MACHINE\SOFTWARE\Ipswitch\IMail\Global and add the entry BlockRuleHdr with a non-zero value. This is a server wide setting and affects all domain and user rules on the server . If BlockRuleHdr is not present or is set to zero, then the X-IMail-Rule header is enabled and will be displayed in the message header.

Notes: The maximum number of characters that will be displayed in the Rule text section of the X-IMail-Rule line is 199.

Tip: The maximum number of characters that will be displayed in the message data section of the X-IMail-Rule line is 30. The Maximum length of any X- IMail-Rule line is 250 characters.

Because IMail Server inserts the rule and 30 characters of the message in the header, special care should be taken if a trapped message is then forwarded to another recipient. Some e-mail clients will include the header in the forwarded message. If this occurs and you have a rule set up to search the body of the message for the same text, then the message will be trapped again.