Adjusting the maximum number of open objects that a MAPI client can use at the same time

Problem:

You experience problems related to Exchange Server limitations. Click the links below to learn more and get solutions.

Solution:

Problems when synchronizing big sets of changes (>250)
(MAPI session limits)

In Exchange Server, the number of message objects that can be opened by a single MAPI session is limited to 250. This limitation can cause problems with syncing of folders that contain a large number of elements. Use the links below to learn about the most common problems.

Errors MAPI_E_CALL_FAILED and MAPI_E_TOO_BIG

Problems might occur when there is a large number of elements (> 250) in a synchronized folder. For example, when a user changes the category of e.g. 500 elements in the source folder in one step, part of the changed elements will not be synchronized in the target folder due to the MAPI limitations. The following error(s) will occur in the software's log files:

Error: Failed to open message from table notification. MAPI_E_CALL_FAILED
Error: Failed to open message from table notification. MAPI_E_TOO_BIG

This problem can be solved in the Registry Editor by adding a value that contains a new number of maximum message objects that are allowed to be opened in a single MAPI session. Make sure that your account belongs to the Local Administrators group and follow these steps:

  1. Go to the Registry Editor (regedit) of each of the MS Exchange Servers where the MS Exchange Information Store service is running (Mailbox role servers).
  2. Locate the registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeIS\ParametersSystem
  3. Right-click ParametersSystem, choose New, then click Key.
  4. Type MaxObjsPerMapiSession and press Enter.
  5. Now right-click MaxObjsPerMapiSession, choose New > DWORD Value.
  6. Type the object type (for example objtMessage) and press Enter to name the entry that changes the default maximum number of objects.
  7. Right-click the entry you created and click Modify.
  8. Go to the Value data box and type the new maximum number of objects to which you want to limit this entry.

    Important

    We recommend to set the maximum value, 2500 (decimal), to solve the problem. If necessary, you can type smaller values and see if they work.

  9. Click OK.
  10. Apply the changes:
    • Exchange Server 2003: reboot the machine.
    • Exchange Server 2007: the changes should be recognized automatically after 5 minutes. If not, reboot the machine.
    • Exchange Server 2010 and newer: restart the MS Exchange Information Store service, or reboot the machine.

 You can learn more from the following Microsoft Technet articles:

Error MAPI_E_FAILONEPROVIDER

Another problem might occur, for example, when the software is processing over 250 mailboxes at the same time. In such a case, you might find the following phrase in the log files of your CodeTwo program:

MAPI_E_FAILONEPROVIDER (0x8004011d)

To solve this problem, you need to reconfigure your Exchange server. Follow the steps below:

  1. Open the following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeIS\ParametersSystem
  2. Add the following DWORD entries with a value greater than 10 000 (which is the default limit):
    • Maximum Allowed Exchange Sessions Per Service
    • Maximum Allowed Sessions Per User
    • Maximum Allowed Service Sessions Per User

      Important

      We recommend setting the maximum value, 65536 (decimal), to all three entries above. If necessary, you can type smaller values and see if they fix the issue.

  3. Add a DWORD entry named Maximum Allowed Concurrent Exchange Sessions Per Service with a decimal value higher than 16. We recommend that you set the maximum value, 128 (decimal). If necessary, you can type smaller values and see if they work.
  4. Add a DWORD entry named Disable Session Limit with the decimal value of 0.
  5. If you are running Exchange 2007, add an extra new DWORD entry named RPC Throttling Factor with the value 5000 (decimal).
  6. Apply the changes:
    • Exchange Server 2003: reboot the machine.
    • Exchange Server 2007: the changes should be recognized automatically after 5 minutes. If not, then reboot the machine.
    • Exchange Server 2010 and newer: restart MS Exchange Information Store service, or reboot the machine.

Additionally, if you are running CodeTwo Exchange Sync, configure it to use multiple RPC connections while contacting your Exchange server:

  1. Go to the Registry Editor (regedit) of the machine where CodeTwo Exchange Sync is installed.
  2. Locate the following registry key:
    • In 32-bit operating systems:
      HKEY_LOCAL_MACHINE/Software/CodeTwo/ExchangeSync
    • In 64-bit operating systems:
      HKEY_LOCAL_MACHINE/Software/Wow6432Node/CodeTwo/ExchangeSync
  3. Right-click on it, choose New > DWORD Value.
  4. Name it UseSeparateRPCConnections and press Enter.
  5. Once again, right-click on the registry value specified in step 2., and choose Modify:
    1. Change Base to Decimal.

    2. Modify Value Data to 1.
  6. Click OK to confirm the changes.
  7. Restart the synchronization service.
  8. Go through the service log files and check if you see the following entry:
    Profile section set with CONNECT_USE_SEPARATE_CONNECTION flag

You are not able to synchronize more than 32 folders
(Exchange throttling limits)

Regardless of the above-described MAPI limits, MS Exchange Server applies throttling to the synchronization actions of CodeTwo Exchange Sync. If you configure 32 or more folders in your synchronization tasks, the throttling policy may affect the MAPI processing in CodeTwo software. As a result, the following errors appear in the software's log files:

Error: Failed to open message store "<MailboxName>\<FolderName>"/ MAPI_E_FAILONEPROVIDER (0x8004011d). module: FoldersGroupCreator.cpp, line: 259, func: CFoldersGroupCreator::operator ()

To overcome this issue, an administrator has to increase the RcaMaxConcurrency limit. This problem is described in two MS Technet articles: here and here.

Below you can find an example of how to apply unlimited RcaMaxConcurrency settings.

  1. Log on to your MS Exchange Server machine.
  2. Run the ems Exchange Management Shell.
  3. Execute the cmdlet below to create a new throttling policy. Change YourNewPolicyName to any name of your choice.
    1. Exchange Server 2010:
      New-ThrottlingPolicy -Name YourNewPolicyName -RCAMAXConcurrency $null
    2. Exchange Server 2013/2016/2019:
      New-ThrottlingPolicy -Name YourNewPolicyName -RCAMAXConcurrency Unlimited
  1. Execute the cmdlet below to assign the newly created throttling policy to the mailbox of the user whose account will be used by the synchronization service. Change MailboxName to the name of the desired mailbox.
    Set-Mailbox -identity MailboxName -throttlingpolicy YourNewPolicyName
  2. Restart the CodeTwo Exchange Sync synchronization service.

See also: