Share via


Limiting Unread Messages in the Gateway

Limiting Unread Messages in the Gateway

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Messages entering the gateway are transferred from the Microsoft® Exchange server to the MTS-OUT folder of the gateway. This folder is located in the mailbox store of the server. The server limits the maximum number of unread messages in all the MTS-OUT folders of the gateway by doing the following:

  • The server tracks the total number of unread messages in all gateway folders. An unread message is a message that has not had the IMessage::SetReadFlag method invoked.
  • If the unread message total reaches the value specified in the MDB-Unread-Limit field of the gateway object, the server does not transfer additional messages to the gateway.
  • After the limit has been reached, the server waits an amount of time specified in the MDB-Backoff-Interval field of the gateway object. After this interval has passed, the server checks the number of unread messages again, and continues waiting if the limit is still exceeded.

The mailbox store only transfers messages from a message transfer queue in the message transfer agent (MTA) to the mailbox store for a gateway if that gateway is logged on. To prevent messages from being stranded in the receive folder of an unresponsive gateway, a timer event is associated with each message that is transferred from the MTA to the mailbox store. If this timer event is triggered, the mailbox store returns a nondelivery report to the originator with the reason code set to MAPI_REASON_TRANSFER_IMPOSSIBLE and the diagnostic code set to MAPI_DIAG_MAXIMUM_TIME_EXPIRED. It then removes the message from the folder.

A gateway cancels the timer event on a message by invoking the IMessage::SetReadFlag method on the message object. It does this by moving the message out of the receive folder or by copying the message. Before the timer is canceled, the message can be deleted by the mailbox store at any time to invalidate the message object.

The mailbox store uses the Time-Out-Period field in the gateway object to set the timer on each message transferred from the message transfer queue to the store. When a nondelivery report is generated by a time out, the following properties are not returned:

  • Properties added to a message and not saved with the IMAPIProp::SaveChanges method.
  • Gateway-specific properties added to a message transfer envelope (MTE) for internal use by the gateway.

A gateway cannot add additional attachments to an MTE until after the timer has been canceled. This enables the store to identify the original message content if a message time out occurs and a nondelivery report must be generated.

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.