一篇文章讲清楚 Exchange 2016/2019邮件大小限制的设置

" title="快乐分享(zhuzengju个人blog)


0

一篇文章讲清楚 Exchange 2016/2019邮件大小限制的设置

编辑:管理员/ 栏目:电子邮件 /发布于:2023年-9月-28日

Exchange一共有三个位置需要配置Exchange上的默认邮件大小限制
组织传输设置
发送/接收连接器设置
用户邮箱设置

1. 打开Exchange Management Shell 使用命令查看默认限制
##查看组织传输配置
get-transportconfig | ft maxsendsize, maxreceivesize

##查看接收连接器配置
get-receiveconnector | ft name, maxmessagesize

##查看发送连接器配置
get-sendconnector | ft name, maxmessagesize

##查看用户邮箱的配置
get-mailbox [用户名] |ft Name, Maxsendsize, maxreceivesize

2、查看结果默认应该如下:
2.1、传输服务不超过35 MB
2.2、所有发送/接收连接器的邮件大小限制均设置为35 MB
2.3、在管理员邮箱上没有设置大小限制(用户级别默认没有限制)

3、3. 打开Exchange Management Shell 使用命令修改大小
修改(发送连接器&接收连接器)组织传输限制
Get-transportconfig | Set-TransportConfig -maxsendsize 50MB -maxreceivesize 50MB

修改接收连接器限制
Get-receiveconnector | set-receiveconnector -maxmessagesize 50MB

修改发送连接器限制
Get-sendconnector | set-sendconnector -maxmessagesize 50MB

修改用户级别限制(可选)
Get-mailbox | Set-Mailbox -Maxsendsize 50MB -maxreceivesize 50MB

修改单个用户限制
Set-Mailbox [用户名] -Maxsendsize 50MB -maxreceivesize 50MB



在 Exchange Server 中配置特定于客户端的消息大小限制
微软原文:https://learn.microsoft.com/zh-cn/exchange/architecture/client-access/client-message-size-limits

对于使用 Exchange ActiveSync 或 Exchange Web Services (EWS) 的Outlook 网页版 (以前称为Outlook Web App) 和电子邮件客户端,可以配置特定于客户端的邮件大小限制。


果更改 Exchange 组织、连接器或用户邮件大小限制,可能需要更改Outlook 网页版、ActiveSync 和 EWS 的限制。 

ActiveSync

服务 配置文件 键和默认值 Size
客户端访问(前端) %ExchangeInstallPath%FrontEnd\HttpProxy\Sync\web.config maxAllowedContentLength="30000000" (默认不存在;请参阅注释) 字节
客户端访问(前端) %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 <add key="MaxDocumentDataSize" value="10240000"> 字节

对 ActiveSync 限制的说明

默认情况下,ActiveSync 的web.config文件中没有 maxAllowedContentLength 键。 但是,ActiveSync 的最大消息大小受应用于服务器上所有网站的 maxAllowedContentLength 值的影响。 默认值为 30000000 字节。 若要在 IIS 管理器中查看邮箱服务器上的 ActiveSync 的这些值,请执行以下步骤:

  1. 请按照以下步骤之一操作:

    • 对于“客户端访问 (前端) 网站,请打开 IIS 管理器,导航到 ”站点>“”默认网站 “,然后选择” Microsoft-Server-ActiveSync”。

    • 对于后端网站,请打开 IIS 管理器,导航到 “站点>”“Exchange 后端 ”,然后选择“ Microsoft-Server-ActiveSync”。

  2. 验证是否已选择底部的“功能视图”选项卡,并在“管理”部分中双击“配置编辑器”。

  3. 单击 “分区 ”字段中的下拉箭头,导航到 system.webServer>安全性 ,然后选择“ requestFiltering”。

  4. In the results, expand requestLimits, and you'll see maxAllowedContentLength and the default value 30000000 (bytes).

若要更改 maxAllowedContentLength 值,请输入以字节为单位的新值,并单击" 应用"。 你需要更改客户端访问网站和后端网站上的值。

注意:可以在 IIS 管理器中更改相同的设置,网址为网站>默认网站>Microsoft-Server-ActiveSync 或站点>Exchange 后端>Microsoft-Server-ActiveSync,然后在“操作”区域中>的“编辑功能设置”中的“IIS”部分>更改请求筛选,“最大允许内容长度 (字节数”) 请求限制部分。
在 IIS 管理器中更改值后,新的 maxAllowedContentLength 键将写入表中所述的相应客户端访问或后端web.config文件。

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 http/https 绑定和身份验证方法的不同组合的 14 个 (实例 maxReceivedMessageSize="67108864") 字节

对 EWS 限制的说明

  • 在后端web.config文件中,UMLegacyMessageEncoderSoap11Element 绑定有两个不需要修改的值maxReceivedMessageSize="1048576"实例。

  • maxRequestLength 是这两个 web.config 文件中的 ASP.NET 设置,但不用于 EWS,因此你无需对其进行修改。

Outlook 网页版

服务 配置文件 键和默认值 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 http 和 https 绑定的 maxReceivedMessageSize="35000000" 2 个 (实例) 字节
后端 %ExchangeInstallPath%ClientAccess\Owa\web.config http 和 https 绑定的 maxStringContentLength="35000000" 2 个 (实例) 字节

对 Web 上的 Outlook限制的说明

  • 在后端web.config文件中,MsOnlineShellService 绑定有一个不需要修改的值maxStringContentLength="102400"实例。





以下操作的注意事项:
Exchange 权限不适用于本主题中的过程。 这些过程在 Exchange Server 的操作系统中执行。
保存的 web.config 配置文件更改在重新启动 IIS 后应用。
考虑到因 Base64 编码导致的 33% 的大小增长,请将所需的新最大大小值 (MB) 乘以 4/3。 要将该值转换成 KB,乘以 1024。 要将该值转换成字节,则乘以 1048756 (1024*1024)。 请注意,Base64 编码导致的大小增长可能会大于 33%,这取决于多种因素,例如,附件的大小、文件类型、压缩和电子邮件客户端。
在 Exchange 服务器上的 Exchange XML 应用程序配置文件(例如,安装 Exchange CU 时,将 覆盖 web.config文件或EdgeTransport.exe.config文件) )中所做的任何自定义 Exchange 或 Internet 信息服务器 (IIS () 设置。 请务必保存此信息,以便在安装后轻松重新应用设置。 安装 Exchange CU 后,需要重新配置这些设置。

配置命令行中客户端特定的邮件大小限制

如果不使用记事本,还可以配置命令行中客户端特定的邮件大小限制。 打开 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 网页版

%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


本文由“快乐分享(zhuzengju个人blog) > 管理员”整理编辑。


未注明为原创的文章以及每篇文章的评论内容都不代表本站观点,本站不对此内容的真实性及言论负责。如您发表评论意见,视为同意本站记录言论您的来源IP地址信息及发表时间。

如果喜欢这篇文章,欢迎订阅快乐分享(zhuzengju个人blog)以获得最新内容。

已经有 0 条群众意见