配置客户端专属邮件大小限制
2021/6/1
本文内容
适用于:Exchange Server 2013
在 Microsoft Exchange Server 2013 中,当邮件经过您的组织时,会应用几种不同的邮件大小Exchange限制。 有关详细信息,请参阅邮件大小限制。
但是,您可以为使用 ActiveSync 或 Outlook Web App Web 服务或 EWS) 的 Exchange 客户端配置特定于客户端 (邮件) 。 如果您更改Exchange组织范围的邮件大小限制,则需要验证是否相应地设置了 Outlook Web App、ActiveSync 和 Exchange Web 服务的邮件大小限制。 您可以在客户端访问服务器web.config邮箱服务器的配置文件中配置这些值。 下表介绍了这些限制。
ActiveSync
服务器角色
配置文件
键和默认值
Size
客户端访问
%ExchangeInstallPath%FrontEnd\HttpProxy\Sync\web.config
maxAllowedContentLength="30000000 bytes" 默认情况下不存在, (注释) 。
字节
客户端访问
%ExchangeInstallPath%FrontEnd\HttpProxy\Sync\web.config
maxRequestLength="10240"
千字节
邮箱
%ExchangeInstallPath%ClientAccess\Sync\web.config
maxAllowedContentLength="30000000 bytes" 默认情况下不存在, (注释) 。
字节
邮箱
%ExchangeInstallPath%ClientAccess\Sync\web.config
maxRequestLength="10240"
千字节
邮箱
%ExchangeInstallPath%ClientAccess\Sync\web.config
字节
对 ActiveSync 限制的说明
默认情况下,ActiveSync 的 文件中没有 maxAllowedContentLength web.config 键。 但是,ActiveSync 的最大邮件大小受应用于服务器上所有网站的 maxAllowedContentLength 值的影响。 默认值为 30000000 字节 (30 MB) 。 若要在 IIS 管理器中的客户端访问服务器和邮箱服务器上查看 ActiveSync 的这些值,请执行以下步骤:
采取以下步骤之一:
在客户端访问服务器上,打开 IIS 管理器,导航到"网站""默认 > 网站",然后选择 "Microsoft-Server-ActiveSync"。
在邮箱服务器上,打开 IIS 管理器,导航到"后端 > Exchange站点"并选择**"Microsoft-Server-ActiveSync"。**
Verify Features View is selected, and double-click Configuration Editor in the Management section.
单击"部分"字段中的下 拉箭头, 导航到 "system.webServer > 安全性",然后选择 "requestFiltering"。
In the results, expand requestLimits, and you'll see maxAllowedContentLength and the default value 30000000 (bytes).
若要更改 maxAllowedContentLength 值,请输入以字节为单位的新值,并单击" 应用"。 您需要更改客户端访问服务器和邮箱服务器上的值。 在 IIS 管理器中更改值后,新的 maxAllowedContentLength 密钥将写入客户端访问服务器和邮箱服务器上 (web.config 文件 %ExchangeInstallPath%FrontEnd\HttpProxy\Sync\web.config %ExchangeInstallPath%ClientAccess\Sync\web.config) 。
若要更改 ActiveSync 客户端的最大邮件大小,您需要更改客户端访问服务器和邮箱服务器上文件中 maxRequestLength 的值、邮箱服务器上文件的 MaxDocumentDataSize 和客户端访问服务器和邮箱服务器上 IIS 管理器中的 web.config web.config maxAllowedContentLength 值。
Exchange Web 服务
服务角色
配置文件
键和默认值
Size
客户端访问
%ExchangeInstallPath%FrontEnd\HttpProxy\ews\web.config
maxAllowedContentLength="67108864"
字节
邮箱
%ExchangeInstallPath%ClientAccess\exchweb\ews\web.config
maxAllowedContentLength="67108864"
字节
邮箱
%ExchangeInstallPath%ClientAccess\exchweb\ews\web.config
的 14 个实例 maxReceivedMessageSize="67108864"
字节
有关 Web Exchange的注释
值有 14 个单独的实例,它们对应于 http 和 https (身份验证方法) maxReceivedMessageSize="67108864" 绑定的不同组合。
若要更改 Exchange Web 服务客户端的最大邮件大小,您需要在这两个文件以及邮箱服务器上文件的所有 14 个实例中更改 maxAllowedContentLength web.config maxReceivedMessageSize="67108864" web.config 的值。
在邮箱服务器的文件中,还有两个不需要修改的 web.config maxReceivedMessageSize="1048576" UMLegacyMessageEncoderSoap11Element 绑定的值实例。
maxRequestLength 是 ASP.NET 设置,存在于两个 web.config 文件中,但 Exchange Web 服务不会使用此设置,因此无需对其进行修改。
Outlook Web App
服务器角色
配置文件
键和默认值
Size
客户端访问
%ExchangeInstallPath%FrontEnd\HttpProxy\owa\web.config
maxAllowedContentLength="35000000"
字节
客户端访问
%ExchangeInstallPath%FrontEnd\HttpProxy\owa\web.config
maxRequestLength="35000"
千字节
邮箱
%ExchangeInstallPath%ClientAccess\Owa\web.config
maxAllowedContentLength="35000000"
字节
邮箱
%ExchangeInstallPath%ClientAccess\Owa\web.config
maxRequestLength="35000"
千字节
邮箱
%ExchangeInstallPath%ClientAccess\Owa\web.config
的 2 个实例 maxReceivedMessageSize="35000000"
字节
邮箱
%ExchangeInstallPath%ClientAccess\Owa\web.config
的 2 个实例 maxStringContentLength="35000000"
字节
有关限制Outlook Web App注释
在 web.config 邮箱服务器的文件中,有两个单独的值实例,它们对应于 http 和 maxReceivedMessageSize="35000000" maxStringContentLength="35000000" https 绑定。
若要更改 Outlook Web App 客户端的最大邮件大小,您需要更改这两个文件的所有这些值,包括邮箱服务器上文件中 maxReceivedMessageSize 和 maxStringContentLength 的实例。 web.config
在邮箱服务器的文件中,还有一个 web.config maxStringContentLength="102400" 无需修改的 MsOnlineShellService 绑定的值实例。
对于所有邮件大小限制,需要设置大于要强制执行的实际大小的值。 在邮件附件和任何其他二进制数据经过 Base64 编码后,需要增加值,以考虑邮件大小增加的异常情况。 Base64 编码将邮件大小增加约 33%,因此您为任何邮件大小限制指定的值比实际可用邮件大小大大约 33%。 例如,如果将最大邮件大小值指定为 64 MB,则预期实际的最大邮件大小值约为 48 MB。
在开始之前,您需要知道什么?
估计完成时间:15 分钟
Exchange 权限不适用于本主题中的过程。这些过程在 Exchange Server 的操作系统中执行。
保存到该配置文件Web.config更改将在重新启动 IIS 后应用。
若要允许由于 Base64 编码而将大小增加 33%,请将所需的新最大大小值乘以 4/3(以 MB 为单位)。 要将该值转换成 KB,乘以 1024。 若要将该值转换为字节,请乘以 1048576 (1024 * 1024) 。 请注意,Base64 编码导致的大小增加可能大于 33%,并取决于多种因素,例如附件文件大小、类型、压缩以及用于撰写和发送邮件的电子邮件客户端。
在您安装 Exchange 累积更新 (CU) 时,您在 Exchange XML 应用程序配置文件(例如,客户端访问服务器上的 web.config 文件,或邮箱服务器上的 EdgeTransport.exe.config 文件)中针对每个服务器所做的任何自定义设置都将被覆盖。请务必保存此类信息,以便在安装累积更新后,您可以轻松地重新配置服务器。安装 Exchange CU 后,您必须重新配置这些设置。
若要了解可能适用于此主题中过程的键盘快捷键,请参阅 Exchange 管理中心内的键盘快捷键。
提示
遇到问题?请访问以下 Exchange 论坛寻求帮助:Exchange Server。
使用记事本配置客户端特定的邮件大小限制
在记事本中打开相应的 web.config 文件。 例如,若要打开 web.config Web 服务Exchange文件,请运行以下命令:
Notepad %ExchangeInstallPath%ClientAccess\exchweb\ews\web.config
Notepad %ExchangeInstallPath%FrontEnd\HttpProxy\ews\web.config
查找本主题前面的表格介绍的相应 web.config 文件中的相关注册表项。 例如,Exchange Web 服务客户端,在邮箱服务器上文件的所有 14 个实例中查找 maxAllowedContentLength maxReceivedMessageSize="67108864" web.config 键。
...maxReceivedMessageSize="67108864"...
例如,若要允许 Base64 编码的最大邮件大小约为 64 MB,请更改 的所有实例 (67108864 89478486 64 * 4/3 * 1048576) :
...maxReceivedMessageSize="89478486"...
完成后,保存并关闭 web.config 文件。
通过运行以下命令来重新启动 IIS:
IISReset /noforce
配置命令行中客户端特定的邮件大小限制
如果不使用记事本,还可以配置命令行中客户端特定的邮件大小限制。打开 Exchange 服务器上提升的命令提示符(通过选择" 以管理员身份运行"打开一个命令提示符窗口)并为要配置的限制运行相应命令。
注意:
命令中的大小值为默认值,可能需要对其进行更改。
请注意值的单位是字节还是千字节。
ActiveSync
%windir%\system32\inetsrv\appcmd.exe set config "Default Web Site/Microsoft-Server-ActiveSync/" -section:system.webServer/security/requestFiltering /requestLimits.maxAllowedContentLength:30000000
%windir%\system32\inetsrv\appcmd.exe set config "Default Web Site/Microsoft-Server-ActiveSync/" -section:system.web/httpRuntime /maxRequestLength:10240
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/Microsoft-Server-ActiveSync/" -section:system.webServer/security/requestFiltering /requestLimits.maxAllowedContentLength:30000000
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/Microsoft-Server-ActiveSync/" -section:system.web/httpRuntime /maxRequestLength:10240
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/Microsoft-Server-ActiveSync/" -section:appSettings "/[key='MaxDocumentDataSize'].value:10240000"
Exchange Web 服务
%windir%\system32\inetsrv\appcmd.exe set config "Default Web Site/ews/" -section:system.webServer/security/requestFiltering /requestLimits.maxAllowedContentLength:67108864
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/ews/" -section:system.webServer/security/requestFiltering /requestLimits.maxAllowedContentLength:67108864
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/ews/" -section:system.serviceModel/bindings "/customBinding.[name='EWSAnonymousHttpsBinding'].httpsTransport.maxReceivedMessageSize:67108864"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/ews/" -section:system.serviceModel/bindings "/customBinding.[name='EWSAnonymousHttpBinding'].httpTransport.maxReceivedMessageSize:67108864"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/ews/" -section:system.serviceModel/bindings "/customBinding.[name='EWSBasicHttpsBinding'].httpsTransport.maxReceivedMessageSize:67108864"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/ews/" -section:system.serviceModel/bindings "/customBinding.[name='EWSBasicHttpBinding'].httpTransport.maxReceivedMessageSize:67108864"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/ews/" -section:system.serviceModel/bindings "/customBinding.[name='EWSNegotiateHttpsBinding'].httpsTransport.maxReceivedMessageSize:67108864"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/ews/" -section:system.serviceModel/bindings "/customBinding.[name='EWSNegotiateHttpBinding'].httpTransport.maxReceivedMessageSize:67108864"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/ews/" -section:system.serviceModel/bindings "/customBinding.[name='EWSWSSecurityHttpsBinding'].httpsTransport.maxReceivedMessageSize:67108864"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/ews/" -section:system.serviceModel/bindings "/customBinding.[name='EWSWSSecurityHttpBinding'].httpTransport.maxReceivedMessageSize:67108864"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/ews/" -section:system.serviceModel/bindings "/customBinding.[name='EWSWSSecuritySymmetricKeyHttpsBinding'].httpsTransport.maxReceivedMessageSize:67108864"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/ews/" -section:system.serviceModel/bindings "/customBinding.[name='EWSWSSecuritySymmetricKeyHttpBinding'].httpTransport.maxReceivedMessageSize:67108864"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/ews/" -section:system.serviceModel/bindings "/customBinding.[name='EWSWSSecurityX509CertHttpsBinding'].httpsTransport.maxReceivedMessageSize:67108864"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/ews/" -section:system.serviceModel/bindings "/customBinding.[name='EWSWSSecurityX509CertHttpBinding'].httpTransport.maxReceivedMessageSize:67108864"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/ews/" -section:system.serviceModel/bindings "/webHttpBinding.[name='EWSStreamingNegotiateHttpsBinding'].maxReceivedMessageSize:67108864"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/ews/" -section:system.serviceModel/bindings "/webHttpBinding.[name='EWSStreamingNegotiateHttpBinding'].maxReceivedMessageSize:67108864"
Outlook Web App
%windir%\system32\inetsrv\appcmd.exe set config "Default Web Site/owa/" -section:system.webServer/security/requestFiltering /requestLimits.maxAllowedContentLength:35000000
%windir%\system32\inetsrv\appcmd.exe set config "Default Web Site/owa/" -section:system.web/httpRuntime /maxRequestLength:35000
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/owa/" -section:system.webServer/security/requestFiltering /requestLimits.maxAllowedContentLength:35000000
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/owa/" -section:system.web/httpRuntime /maxRequestLength:35000
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/owa/" -section:system.serviceModel/bindings "/webHttpBinding.[name='httpsBinding'].maxReceivedMessageSize:35000000"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/owa/" -section:system.serviceModel/bindings "/webHttpBinding.[name='httpBinding'].maxReceivedMessageSize:35000000"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/owa/" -section:system.serviceModel/bindings "/webHttpBinding.[name='httpsBinding'].readerQuotas.maxStringContentLength:35000000"
%windir%\system32\inetsrv\appcmd.exe set config "Exchange Back End/owa/" -section:system.serviceModel/bindings "/webHttpBinding.[name='httpBinding'].readerQuotas.maxStringContentLength:35000000"
如何判断是否生效?
若要验证是否成功配置了客户端特定的邮件大小限制,您需要在受影响的客户端正在访问的邮箱之间发送测试邮件。 可以尝试添加一些更小的附件或一个大的附件,以使测试邮件的大小比配置的值约小 33%。 例如,如果配置的值为 85 MB,则实际邮件的最大大小约为 64 MB。