Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

An Exchange Server 2007 Transport Rule does not work as expected


View products that this article applies to.

Symptoms

A Microsoft Exchange Server 2007 Transport Rule does not work as expected. For example, an email message that an administrator expects to be rejected may instead be delivered.

↑ Back to the top


Cause

This issue can occur if the Transport Rule is based on a regular expression. For example, this issue can occur if you use the "$" character to create a pattern-matching regular expression.

Note Microsoft Exchange Server 2007 and Microsoft Exchange Server 2010 do not implement the full Microsoft .NET Framework regular expression classes. Additionally, the intermediate language that is generated may be incorrect.

↑ Back to the top


Workaround

To work around this issue, use one of the following methods.

Method 1

Create a Transport Agent and then implement your own .NET Framework regular expressions to route email messages.

Method 2

Use a filter to automatically process email messages. For example, use Microsoft ForeFront Security for Exchange Server to filter email messages based on the email originator and email recipient.

↑ Back to the top


More information

Regular expressions are a powerful, flexible way to evaluate a character sequence for matching against a given series of characters. Typically, a regular expression is written in a programming language such as C++ or C#. The regular expression can then be interpreted by a regular expression processor. The processor examines the character sequence and identifies parts that match the provided characters.

You can create a Transport Rule based on regular expressions in the Exchange Management Shell (EMS) by using the New-TransportRule cmdlet. When you use the Conditions parameter, the Exchange regular expression implementation is used. You can use regular expressions in any predicate that accepts the "Patterns" predicate property.

Transport Rule conditions and exceptions consist of one or more predicates. Predicates instruct the Transport Rules agent on a Hub Transport server (or the Edge Rules agent on an Edge Transport server) to examine a specific part of an email message. Those specific parts include sender, recipients, subject, other message headers, and message body. Then, the Transport Rule determines whether the rule should be applied to that message. Therefore, predicates act as building blocks for conditions and exceptions.

In the Exchange Management Console, you can use regular expressions with any condition or exception that contains the words "text patterns." For example, you can use regular expressions with the following condition:
"when the From address contains text patterns"


Note The "Patterns" predicate accepts a regular expression that can be used to match text that follows an identifiable pattern. You must enclose the expression in quotation marks (").

↑ Back to the top


References

For more information about Transport Agents in Exchange Server 2010, visit the following TechNet website:

For information about how to use the NewTransportRule cmdlet, visit the following TechNet website:

For information about regular expressions and how to use regular expressions in Exchange Server 2007 Transport Rules, visit the following TechNet website:

For information about how to use predicates to create conditions and exceptions in an Exchange Server 2010 Transport Rule, visit the following TechNet website:

↑ Back to the top


Keywords: KB2673160, kbprb, kbsurveynew

↑ Back to the top

Article Info
Article ID : 2673160
Revision : 3
Created on : 3/1/2012
Published on : 3/1/2012
Exists online : False
Views : 334