設定用戶端特定的郵件大小限制

適用於:Exchange Server 2013

Microsoft Exchange Server 2013 對於通過您 Exchange 組織的郵件設有數種不同的適用郵件大小限制。 如需詳細資訊,請參閱 訊息大小限制

不過,您可針對 Outlook Web App 以及使用 ActiveSync 或 Exchange Web 服務 (EWS) 的電子郵件用戶端,設定用戶端特定的郵件大小限制。 如果您變更整個 Exchange 組織的訊息大小限制,您必須確認已據以設定 Outlook Web App、ActiveSync 和 Exchange Web 服務的訊息大小限制。 您可以在用戶端存取伺服器和信箱伺服器上的 web.config 檔案中設定這些值。 下表說明這些限制。

Exchange ActiveSync

伺服器角色 設定檔案 索引鍵和預設值 大小
用戶端存取 %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 <add key="MaxDocumentDataSize" value="10240000"> 位元組

ActiveSync 限制的批注

根據預設,ActiveSync 的檔案中web.config沒有 maxAllowedContentLength 密鑰。 不過,套用至伺服器上所有網站的 MaxAllowedContentLength 值會影響 ActiveSync 的訊息大小上限。 默認值為 30000000 位元組 (30 MB) 。 若要在 IIS 管理員的用戶端存取伺服器和信箱伺服器上查看 ActiveSync 的這些值,請執行下列步驟:

  1. 執行下列其中一個步驟:

    • 在 [用戶端存取伺服器] 上,開啟 [IIS 管理員],流覽至 [ 網站>默認網站] ,然後選取 [Microsoft-Server-ActiveSync]
    • 在信箱伺服器上,開啟 [IIS 管理員],流覽至 [網站>] [Exchange 後端 ],然後選取 [Microsoft-Server-ActiveSync]
  2. 確認已選取 [功能檢視],然後按兩下 [管理] 區段中的 [組態編輯器]。

  3. 按兩下 [ 區段 ] 欄位中的下拉式箭號,流覽至 system.webServer>安全 性,然後選取 requestFiltering

  4. 在結果中,展開 requestLimits,您會看到 maxAllowedContentLength 和預設值 30000000 (位元組) 。

若要變更 maxAllowedContentLength 值,請輸入以位元組為單位的新值,然後按兩下 [ 套用]。 您需要變更 Client Access 伺服器和信箱伺服器上的值。 在 IIS 管理員中變更值之後,新的 maxAllowedContentLength 金鑰會寫入用戶端存取伺服器上的對應 web.config 檔案 (%ExchangeInstallPath%FrontEnd\HttpProxy\Sync\web.config ,並在 %ExchangeInstallPath%ClientAccess\Sync\web.config 信箱伺服器上) 。

若要變更 ActiveSync 用戶端的郵件大小上限,您必須變更 Client Access 伺服器和信箱伺服器上檔案中的 web.configmaxRequestLength 值、信箱伺服器上檔案中的 web.configMaxDocumentDataSize,以及在用戶端存取伺服器和信箱伺服器的 IIS 管理員中變更 maxAllowedContentLength 的值。

Exchange Web 服務

提供角色 設定檔案 索引鍵和預設值 大小
用戶端存取 %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" 位元組

Exchange Web 服務限制的批注

  • 值有 14 個不同的實 maxReceivedMessageSize="67108864" 例,這些實例會對應至不同的系結組合, (HTTP 和 https) 和驗證方法。

  • 若要變更 Exchange Web 服務用戶端的郵件大小上限,您必須在這兩web.config個檔案中變更 maxAllowedContentLength 的值,以及信箱伺服器上檔案中web.config的所有 14 maxReceivedMessageSize="67108864" 個實例。

  • web.config在Mailbox伺服器上的檔案中,您不需要修改UMLegacyMessageEncoderSoap11Element系結值的兩maxReceivedMessageSize="1048576"個實例。

  • maxRequestLength 是同時存在於 web.config 檔案中的 ASP.NET 設定,但 Exchange Web Services 不會使用此設定,因此您不需要加以修改。

Outlook Web App

伺服器角色 設定檔案 索引鍵和預設值 大小
用戶端存取 %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 Mailbox伺服器上的檔案中,有兩個不同的值 maxReceivedMessageSize="35000000" 實例,對 maxStringContentLength="35000000" 應至 HTTP 和 HTTPs 系結。

  • 若要變更 Outlook Web App 用戶端的訊息大小上限,您必須變更這兩個檔案中的所有值,包括Mailbox伺服器上檔案中的 web.configmaxReceivedMessageSizemaxStringContentLength 兩個實例。

  • web.config在Mailbox伺服器上的檔案中,還有您不需要修改的 MsOnlineShellService 系結值maxStringContentLength="102400"實例。

針對所有郵件大小限制,您必須設定需要強制大於實際大小的值。 針對郵件附件以及其他任何採用 Base64 編碼的二進位資料,增加這些值必然會導致郵件大小增加。 Base64 編碼會使郵件大小增加約 33%,因此您所指定的任何郵件大小限制值皆會較實際可用郵件大小增加 33%。 例如,若您指定的郵件大小上限值為 64 MB,則實際的郵件大小上限值約為 48 MB。

開始之前有哪些須知?

  • 預估完成時間:15 分鐘

  • Exchange 權限無法套用於此主題的程序。 在 Exchange 伺服器的作業系統中執行這些程序。

  • 您儲存至 Web.config 組態檔的變更將在重新啟動 IIS 後套用。

  • 為了支援因採用 Base64 編碼而增加 33% 的大小,請將需要的新大小上限值 (單位為 MB) 乘以 4/3。 將值轉換為 KB (乘以 1024)。 若要將值轉換成位元組,請乘以 1048576 (1024*1024) 。 請注意,採用 Base64 編碼可能導致大小增加 33%,且會根據數種因素而定,例如附件檔案大小、類型、壓縮,以及用於撰寫和傳送郵件的電子郵件用戶端等等。

  • 在您安裝 Exchange 累計更新 (CU) 後,將會覆寫您在 Exchange XML 應用程式組態檔 (例如 Client Access Server 上的 web.config 檔案,或 Mailbox Server 上的 EdgeTransport.exe.config 檔案) 中任何自訂的個別伺服器設定。 請務必儲存此資訊,以便安裝後能輕易地重新設定伺服器。 在安裝 Exchange CU 後,您必須重新配置這些設定。

  • 如需適用於此主題中程序的快速鍵相關資訊,請參閱 Exchange 系統管理中心的鍵盤快速鍵

提示

有問題嗎? 在 Exchange 論壇中尋求協助。 瀏覽 Exchange Server 的論壇。

使用記事本設定用戶端特定的訊息大小限制

  1. 在記事本中開啟適當的 web.config 檔案。 例如,若要開啟 Exchange Web Services 用戶端的 web.config 檔案,請執行下列命令:

    Notepad %ExchangeInstallPath%ClientAccess\exchweb\ews\web.config
    Notepad %ExchangeInstallPath%FrontEnd\HttpProxy\ews\web.config
    
  2. 如本主題稍早的數據表所述,在適當的 web.config 檔案中尋找相關密鑰。 例如,針對 Exchange Web 服務用戶端,請在兩個檔案中尋找 maxAllowedContentLength 密鑰,以及信箱伺服器上檔案中web.config所有 14 個值maxReceivedMessageSize="67108864"實例。

    <requestLimits maxAllowedContentLength="67108864" />
    ...maxReceivedMessageSize="67108864"...
    

    例如,若要允許Base64編碼的訊息大小上限約為64 MB,請將的所有實例 67108864 變更為 89478486 (64*4/3*1048576) :

    <requestLimits maxAllowedContentLength="89478486" />
    ...maxReceivedMessageSize="89478486"...
    
  3. 當您完成時,請儲存並關閉 web.config 檔案。

  4. 執行下列命令以重新啟動 IIS:

    IISReset /noforce
    

從命令行設定用戶端特定的訊息大小限制

您也可以從命令行設定用戶端特定的訊息大小限制,而不是使用記事本。 在 Exchange Server 上開啟提升許可權的命令提示字元 (您選取 [以系統 管理員 身分執行]) 開啟的 [命令提示字元] 視窗,然後針對您想要設定的限制執行適當的命令。

附註

  • 命令中的大小值是預設值,因此您需要變更它們。

  • 請注意值是以位元組或 KB 為單位。

設定 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。