Cannot send large messages via ActiveSync, iPhone/iPad
When sending from a Mobile device via the ActiveSync service the device fails to send.
Some devices may return an error indicating that “The message that was sent to the server was rejected because the message was too large”. (Apple iPad iOS). Not all mobile devices behave this way and may just keep the message in the outbox folder and retried until removed from the folder.
Ther are number of reasons, couple of them listed below.
First one I have found is ActiveSync limit set to 10MB (%ExchangeInstallPath%ClientAccess\Sync\web.config maxRequestLength=”10240″)
A global IIS restriction preventing uploads larger than 49152 Bytes.
IIS 7.5 sets a default value of 49152 Bytes for the “UploadReadAheadSize” value which limits the amount of bytes allowed in the entity body of a request and the number of bytes a Web server will read into a buffer and pass to an ISAPI extension.
- Navigate within IIS to the “Sites” node.
- Determine the ID for the “MailEnable Protocols” website
- Next navigate to the IIS log files path: C:\inetpub\logs\LogFiles
- Locate the W3SVC(ID) folder, where ID is the number of the website ID above in step 2.
- Sort the log files by “Date Modified’ and then open the latest log files in respect to the date/time you sent the message from the mobile device.
- Search for lines like the examples below:
2020-03-27 20:33:38 192.168.0.1 POST /Microsoft-Server-ActiveSync Userfirstname.lastname@example.org&DeviceId=ApplDMRL2W3PF169&DeviceType=iPad&Cmd=SmartForward 443 – 192.168.0.2 Apple-iPad3C4/1102.55400001 413 0 0 6396
2020-03-27 20:33:38 192.168.0.1 POST /Microsoft-Server-ActiveSync Useremail@example.com&DeviceId=ApplDMRL2W3PF169&DeviceType=iPad&Cmd=SendMail 443 – 1922.214.171.124 Apple-iPad3C4/1102.55400001 413 0 0 6396
The above log snippets report a 413 error in the line which indicates the “Request Entity is too large”.
Incorrect authentication settings in Exchange Server Virtual Directory.
RESOLUTION – 1
Change the limit set on web.config, note this settings below for Frontend backed servers with different CAS and Mailbox server. For single server web.config is located in
C:\Program Files\Microsoft\Exchange Server\v14\ClientAccess\Sync\web.config has the following lines of code:
<!– Allow maximum 10 megs of content –>
<httpRuntime madRequestLength=”10240″ />
v14 is different verions of Exchange.
|Server role||Configuration file||Keys and default values||Size|
Comments on ActiveSync limits
By default, there is no maxAllowedContentLength key in the
web.config files for ActiveSync. However, the maximum message size for ActiveSync is affected by the maxAllowedContentLength value that is applied to all web sites on the server. The default value is 30000000 bytes (30 MB). To see these values for ActiveSync on Client Access Servers and Mailbox servers in IIS Manager, perform the following steps:
- Do one of the following steps:
- On Client Access servers, open IIS Manager, navigate to Sites > Default Web Site and select Microsoft-Server-ActiveSync.
- On Mailbox servers, open IIS Manager, navigate to Sites > Exchange Back End and select Microsoft-Server-ActiveSync.
- Verify Features View is selected, and double-click Configuration Editor in the Management section.
- Click the dropdown arrow in the Section field, navigate to system.webServer > security and select requestFiltering.
- In the results, expand requestLimits, and you’ll see maxAllowedContentLength and the default value 30000000 (bytes).
To change the maxAllowedContentLength value, enter a new value in bytes, and click Apply. You need to change the value on Client Access servers and on Mailbox servers. After you change the value in IIS Manager, a new maxAllowedContentLength key is written to the corresponding
web.config file (
%ExchangeInstallPath%FrontEnd\HttpProxy\Sync\web.config on Client Access servers, and
%ExchangeInstallPath%ClientAccess\Sync\web.config on Mailbox servers).
To change the maximum message size for ActiveSync clients, you need to change the value of maxRequestLength in the
web.config file on Client Access servers and Mailbox servers, MaxDocumentDataSize in the
web.config file on Mailbox servers, and maxAllowedContentLength in IIS Manager on Client Access servers and Mailbox servers.
- RESOLUTION – 2
- Open a Windows command prompt with administrator rights and navigate to the following location: C:\inetpub\AdminScripts
- Run the following command: cscript adsutil.vbs set w3svc/14/uploadreadaheadsize 51200000
Where “14” in the above command is the website ID
RESOLUTION – 3
Check the virtual directory authentication settings in the Exchange server for
EWS (Default Web Site), it should be
Integrated windows authentication only and for
Microsoft-Server-ActiveSync (Default Web Site) authentication set to
Basic authentication and ignore client certificate