Exchange 2007: Mail-enabled Public Folder Transport

Usually there is one question that is always asked when dealing with mail-enabled public folders: How does the message get delivered to a replica? To answer that question, let's take a walk down memory lane. Exchange 5.5: In Exchange 5.5 we used to store replica information in the directory (aka "home server" field on public […]

Usually there is one question that is always asked when dealing with mail-enabled public folders: How does the message get delivered to a replica? To answer that question, let's take a walk down memory lane.

Exchange 5.5: In Exchange 5.5 we used to store replica information in the directory (aka "home server" field on public folders). This allowed us to determine a replica to route to immediately upon categorization of the message.

This did have its faults though. You had to manage each public folder and its home server designation (i.e. a single point of failure). In addition, because we did store that information in the directory, DS/IS Consistency Check needed to be executed routinely to clean up the directory or to re-home the replica if the site containing it was no longer present.

Exchange 2000 / 2003: In Exchange 2000 / 2003 we moved away from storing replica information in the directory and instead just stored it within the public folder hierarchy. Now the only thing stored in the Active Directory is a proxy object for the public folder that basically tells us the email address and that it's a public folder proxy object. So as a result of these changes we had to change the way transport dealt with SMTP messages destined for public folders.

The basic process is (for in-depth information, take a look at http://msexchangeteam.com/archive/2004/09/10/228114.aspx):

1. SMTP mail addressed to Public Folder comes into transport.

2. Transport categorizes the message and obtains a list of all PF stores for that hierarchy.  We then pick a store and route the message to it:

a. If a PF store is on the same server, we use that.

b. If there are no local PF stores, then we'll use a PF store in the same routing group.

c. If there are no local PF stores in the routing group, then we use the first entry in the list from msExchOwningPFTreeBL entry.

This list always has the most recently added public folder stores to the organization at the top (and as a public folder store is created when a new server is installed, normally this means the most recently installed servers will be at the top of the list). What could happen is we pick a server that has just been added to the org and may not have the full public folder hierarchy yet (and hence not know what to do with the message). To prevent this in Exchange 2003, we don't select any stores younger than two days, unless there is no alternative. See http://support.microsoft.com/kb/328870/en-us for more information on use of PF store Age in routing decisions.

3. If there is a replica on this store, then the message is simply delivered. If not, the store returns the location of the closest replica and hands the message back to transport – which then sends it on to the store which actually holds the replica.

Exchange 2007 RTM: In Exchange 2007 we made some fundamental changes to the way transport works (see http://technet.microsoft.com/en-us/library/aa998825.aspx for more information):

  • No more routing groups. Instead we will use the Active Directory topology for determining the least cost route.
  • Direct Connections are preferred. When possible the source Hub Transport server will establish a direct TCP connection with the destination Hub Transport server that resides in the Active Directory site where the mailbox or replica resides. No more passing it along a chain of Exchange servers if we can avoid it.

So how does that change Public Folder mail routing? Well let's take a look at the stages.

Routing Table Calculation: When the Microsoft Exchange Transport service starts on a Hub Transport Server (or when a change notification occurs, or after 6 hours), it calculates a set of routing tables that is based on the snapshot of information that is retrieved from Active Directory. The routing component refers to the routing tables to determine how to route messages to recipients. When configuration changes are made, the routing tables are rebuilt. The new routing tables are used to route new incoming messages. Messages in remote delivery queues are also rerouted if the routing component determines that they are affected by the configuration changes. For more information on the routing table calculation, please see http://technet.microsoft.com/en-us/library/aa998825.aspx.

Public folder hierarchies are one item that is retrieved during the calculation of the routing tables. Specifically, to ensure that proper delivery can occur to the public folder replica, the "best" public folder store is chosen by reviewing the msExchOwningPFTreeBL directory entry (Note: The msExchOwningPFTreeBL list always has the most recently added public folder stores at the top) using the following criteria (at RTM):

1. First and foremost, if the list contains any legacy Exchange PF stores, they are removed if Exchange 2007 PF stores exist. Age of the store is not considered when building this list.

2. If the choice is between two (or more) Exchange 2007 PF stores, then the following criteria will be used:

a. Age Ranking (PF store less than 2 days old by default will not be considered, unless the store's age is less than the threshold or is unknown).

b. If there is a local PF store on the same physical machine, we will use that.

c. If there is not a local PF store, then we will choose a store within the local Active Directory Site. If there are multiple PF stores, the first server returned is chosen.

d. If there are no PF stores within the local Active Directory site, then we will choose a PF store in a remote Active Directory Site, sorted by lowest cost (if the choice is between two or more remote AD sites). If the result is a tie, the first server returned is chosen.

3. In the event that there are no Exchange 2007 PF stores, and if the choice is between two (or more) legacy Exchange PF stores, then the following criteria will be used:

a. Age Ranking (PF store less than 2 days old by default will not be considered, unless the store's age is less than the threshold or is unknown).

b. If there are multiple PF stores, then the first store is chosen.

View: Full post

Microsoft, Exchange, Server, Transport & Routing, Exchange 2007