Aug 092019
 
IIS Logo Image

You may find yourself unable to download attachments on an e-mail message you received on your Android or Apple iPhone from your Microsoft Exchange Server. In my case, this presented a “Unable to download.” with a retry option. Retrying would not work.

If the attachment is larger (over 10MB), this is most likely due to a limit enforced on the Activesync site in IIS on your Exchange Server. In this post I’m going to tell you why this happens, and how to fix it!

The Problem

Microsoft Exchange uses IIS (Internet Information Server) for numerous services including ActiveSync. ActiveSync provides the connectivity to your mobile device for your Exchange access.

IIS has numerous limits configured to stop massive bogus requests, reduce DDOS attacks, and other reasons.

The Fix

To resolve this and allow the attachment to download, we need to modify two configuration values inside of the web.config file on IIS.

Below are the values we will be modifying:

  • MaxDocumentDataSize – Maximum file (message) data size for transfer. “Sets the maximum data size that we will fetch (range or othewise)”
  • maxRequestLength – “Specifies the limit for the input stream buffering threshold, in KB. This limit can be used to prevent denial of service attacks that are caused, for example, by users posting large files to the server. The default is 4096 KB.” (as per here)

These settings are configured in the following file:

C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\Sync\web.config

Before modifying the variables, please make a copy or backup of the web.config file so you can restore.

After you make a backup, open the file in notepad (right click -> run as administrator), and open the web.config file.

Simply search for the two values listed above, and change them. In my case, I tripled the “MaxDocumentDataSize”, and the “maxRequestLength” values. Examples from my “web.config” file are below:

add key="MaxDocumentDataSize" value="30720000"
httpRuntime maxRequestLength="30720" fcnMode="Disabled"

After changing these, run the following command from an elevated (as administrator) command prompt to restart IIS:

iisreset

And bam, you’re good to go!

  10 Responses to “Cannot download attachment (due to size) with mobile device on Exchange ActiveSync”

  1. Nice post man. Thanks!

  2. Working! Thank you very much sir

  3. Awesome…thank you.

  4. Where do I find c:\program…. on my mobile device?

  5. Hi Larry, these instructions are for desktop PCs.

  6. Thanks for the article Stephen! I made these modifications and still wasn’t able to open attachments larger than 2MB. Do you have any suggestions on where to look next?

  7. Hi Marcus,

    Did you restart all applicable services to make sure that everything took effect? Also, do you have any other limits configured? What error are you seeing?

    Cheers,
    Stephen

  8. Oops, I just noticed that you had replied to my question. Sorry for the extended delay! I restarted the services and still no success. The main symptom of the problem is that any email attachments larger than 2MB cannot be opened on mobile devices using Outlook or Apple Mail. I dug through this documentation from Microsoft but wasn’t able to find any settings that were misconfigured. https://learn.microsoft.com/en-us/exchange/mail-flow/message-size-limits?view=exchserver-2019

  9. Hi Marcus,

    That link you posted is for the message size limits (which is for mail transmission, not ActiveSync). If your devices are failing on downloading the attachments, you need to increase the IIS request sizes as IIS handles ActiveSync access.

    Cheers,
    Stephen

  10. Hi Stephen,

    In addition, I checked all of these settings as well, which includes the settings you mentioned above: https://learn.microsoft.com/en-us/exchange/architecture/client-access/client-message-size-limits?view=exchserver-2019

    Are there other settings that need to be configured?

    Thanks,
    Marcus

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)