Set Message Size Limits for Exchange Web Services


Applies to: Exchange Server 2010 SP3, Exchange Server 2010 SP2

You can modify message size limits to increase or decrease the size of e-mail messages that clients may send or receive.

To configure message size limits, you modify the following parameters on the Send and Receive connectors on the Hub Transport servers:

  • maxReceiveSize

  • maxSendSize

  • maxMessageSize

To view the Send and Receive limits for your Exchange organization, use the following cmdlet:

Get-TransportConfig |fl max*size

To view the Send and Receive limits for individual mailboxes, use the following cmdlets:

Get-Mailbox –id sender |fl max*size

Get-Mailbox –id recipient |fl max*size

To determine whether the sender and recipient have enough room left in their mailboxes, you can run the following Exchange Management Shell cmdlets:

Get-MailboxStatistics –id sender | fl StorageLimitStatus,TotalItemSize

Get-Mailbox sender | fl prohibit*quota

Get-Mailbox sender | foreach {Get-MailboxDatabase –id $_.mailboxdatabase | fl prohibit*quota}

Get-MailboxStatistics –id recipient | fl StorageLimitStatus,TotalItemSize

Get-Mailbox recipient | fl prohibit*quota

Get-Mailbox recipient| foreach {Get-MailboxDatabase –id $_.mailboxdatabase | fl prohibit*quota}

Additionally, you must configure both of the following parameters in the Exchange Web Services (EWS) Web.config file for clients that use Exchange Web Services such as Microsoft Entourage 2008 for Mac, Web Services Edition to submit e-mail messages to Exchange:

  • maxAllowedContentLength – This setting is used by the Request filtering role service in Internet Information Services 7 (IIS) to protect the Web server from receiving requests that are too large.

    The default values for this parameter are:

    Exchange 2007= 30000000 bytes Exchange 2010= 35000000 bytes


    A change to this setting requires a restart of the MSExchangeServicesAppPool application pool. You can verify or modify this setting in the following ways.

  • maxRequestLength - ASP.NET uses the maxRequestLength setting to determine the maximum amount of data that the Web browser can submit to the Client Access server. This setting is configured initially by Exchange Setup as an entry in the Web.config file for the Exchange Web Services application in IIS.

    Default for Exchange 2007 = 13280 KB

    Default for Exchange 2010 = 2097151 KB

  • maxReceivedMessageSize – This setting applies only to Microsoft Exchange Server 2010. It indicates the maximum message size that is accepted by EWS. This maximum message size is 35,000,000 bytes, which translates to 25 MB of Base64-encoded data.

    The default values for this parameter are:

    Exchange 2010 RTM = 13600000 Bytes Exchange 2010 SP1 = 35000000 Bytes


    The values for this limit differ for an on-premise Exchange 2010 deployment.

  • connectionTimeout - This setting is used to provide a connection time limit. Because this parameter affects traffic to the Web site, we do not recommend changing this value unless you receive HTTP 408 error messages. The recommended method for changing this value is to use the IIS Configuration editor. The Configuration Editor is part of the IIS Administration Pack.


The size of a message is determined by the size of the message body plus the size of any attached files. For Microsoft Exchange Server 2010 Service Pack 1 (SP1), the default message size restrictions are set to 35 million bytes. This accommodates approximately 25 MB of Base64-encoded data. For Microsoft Exchange Server 2010, the default message size restrictions are set to 13.6 million bytes. This accommodates approximately 10 MB of Base64-encoded data.


After you set the message size properties for Exchange Web Services, you must stop and then start the Default Web site.

For information about other management tasks that are related to setting up message size limits, see Understanding Message Size Limits.

Use a text editor to modify the Web.config file

To modify the Web.config file, follow these steps:

  1. Start Windows Explorer, and then locate the Web.config file. By default, this file is located in the following directory:

    %ProgramFiles%\Microsoft\Exchange Server\V14\ClientAccess\exchweb\ews

  2. Create a copy of the file as a backup.

  3. Open the Web.config file by using a text editor, such as Notepad.

  4. Search for the maxAllowedContentLength entry. By default, this entry appears as follows in Microsoft Exchange Server 2010 RTM:

    <requestLimits maxAllowedContentLength=”13600000” />

  5. Change the value for maxAllowedContentLength to accommodate the message size that you want to allow. Because message attachments are Base64-encoded before they are transferred, the value must be set high enough to accommodate the desired message size together with the encoding overhead.

    For example, to allow messages of approximately 20 MB, perform the following calculation:

    20971520 bytes * 4/3 for Base64 encoding = 27962027 (rounded up)


    In this formula, the fraction 4/3 represents a message that is approximately 33 percent larger than the original. However, message size increase may be much larger, depending on the type of attachment that is sent, the attachment size, whether the attachment is already compressed, and the messaging client from which the message is sent. In some cases, you may experience message size increases of 100 percent after encoding (that is, messages that are twice the size of the original messages).

  6. Search for maxReceivedMessageSize. This entry is listed after the EWSServiceBehavior entries. By default, this entry appears as follows in Exchange 2010 RTM:

    <httpsTransport maxReceivedMessageSize=”13600000” authenticationScheme=”Anonymous” maxBufferSize=”81920” transferMode=”Streamed” />

  7. Change the value for maxReceivedMessageSize to the same value as for maxAllowedContentLength to accommodate the desired message size together with the base64 encoding overhead.

  8. Save the changes to the Web.config file, and then exit the text editor.

  9. Stop and then start the default Web site for the settings to take effect.


    You must configure at least the same message size limits on the appropriate transport servers to support the increased message size. For more information, see Understanding Message Size Limits.

 © 2010 Microsoft Corporation. All rights reserved.