Site icon Franky's Web

Exchange 2016: Change size limit for ActiveSync

Size limits for emails can be set in several places with Exchange Server 2016. There are size limits for mails not only for receiving and sending connectors, but also for ActiveSync, Exchange Web Services (EWS) and OWA (or Outlook on the Web).

The standard limit for ActiveSync clients is 10 MB, whereas the limit for EWS is 64 MB and for OWA 35 MB. However, Base64 encoding must also be taken into account here. Base64 encoding increases the size of the mail by approx. 33%. For ActiveSync this means that a mail may only be approx. 7 MB in size, for EWS it is approx. 48 MB. It is not possible to say exactly how large a mail may be, but the following can be used as a rule of thumb:

If users of tablets and smartphones want to send mails via ActiveSync that are larger than approx. 7 MB, the limit can be increased accordingly.

Manual adjustment of the active sync limit

The limit for ActiveSync can be set manually by editing the IIS configuration in the IIS Manager and the web.config of the ActiveSync directory. It is somewhat easier to do this using a script (see below), so the manual method is more suitable for checking the settings or for small Exchange organizations.

To do this, select the configuration editor for the ActiveSync directory in the IIS Manager:

The "system.webServer/security/requestFiltering" section can now be selected:

The "maxAllowedContentLength" setting can be found under "requestLimits". In the default setting, a value of 30000000 bytes is specified here, which roughly corresponds to 28 MB. If it is planned to increase the ActiveSync limit to a value below 28 MB, the default value can therefore be retained. For larger ActiveSync limits, such as 50 MB, the value must be increased accordingly. In this example, the limit is set to approx. 50 MB for the actual mail size:

The value for "maxAllowedContentLength" therefore corresponds to 69730304 in this example:

The same settings must now be repeated once for the Exchange Back End:

After the configuration has been adjusted in the IIS Manager, the corresponding web.config files can now be found in the following directories:

Note: The web-config files only exist once the value has been adjusted in the IIS Manager.

The following line must now be edited in both files, here the value is now specified in kilobytes:

50 MB + 33 % = 66.5 MB (equivalent to 68096 kilobytes)

Another value must be adjusted in the web.config of the backend, but here it is bytes again:

50 MB + 33 % = 66.5 MB (converted 69730304 bytes)

After the settings have been made, the IIS must be restarted using "iisreset".

Adjusting the ActiveSync limit via script

The following small script can be used to set the appropriate settings. The script sets the limit for Active Sync to 66.5 MB, which corresponds approximately to an actual mail size of 50 MB. If there are multiple Exchange 2016 servers in the organization, the script must be executed on all Exchange servers:

%windir%\system32\inetsrv\appcmd.exe set config "Default Web Site/Microsoft-Server-ActiveSync/" -section:system.webServer/security/requestFiltering /requestLimits.maxAllowedContentLength:69730304
%windir%\system32\inetsrv\appcmd.exe set config "Default Web Site/Microsoft-Server-ActiveSync/" -section:system.web/httpRuntime /maxRequestLength:68096
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/Microsoft-Server-ActiveSync/" -section:system.webServer/security/requestFiltering /requestLimits.maxAllowedContentLength:69730304
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/Microsoft-Server-ActiveSync/" -section:system.web/httpRuntime /maxRequestLength:68096
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/Microsoft-Server-ActiveSync/" -section:appSettings /[key='MaxDocumentDataSize'].value:69730304

After the script has been executed, the IIS must be restarted:

iisreset

The limits can be adjusted in the script, but attention must be paid to the different units:

Note

Since the settings for the limits are made in the web.config, it can happen that the default values apply again after the installation of Exchange updates. After a CU for Exchange 2016 has been installed, the settings should therefore be checked. A small batch script as described above can also be executed as a precaution after an Exchange update (do not forget to reset IIS).

Exit mobile version