在 Exchange Server 中設定用戶端特定的訊息大小限制

在Exchange Server中,有數個不同的訊息大小限制會在訊息通過您的組織時套用至訊息。 如需詳細資訊,請參閱Exchange Server中的郵件大小和收件者限制

不過,您可以針對先前稱為 Outlook Web App) 和使用 Exchange ActiveSync 或 Exchange Web Services (EWS) 之電子郵件用戶端的Outlook 網頁版 (,設定用戶端特定的訊息大小限制。 如果您變更 Exchange 組織、連接器或使用者訊息大小限制,您可能需要變更Outlook 網頁版、ActiveSync 和 EWS 的限制。 下表說明這些限制。 若要變更特定用戶端類型的訊息大小限制,您必須變更資料表中所述 的所有 值。

注意事項

針對任何郵件大小限制,您設定的值必須大於要執行的實際大小。 這說明了附件和其他二進位資料的 Base64 編碼。 Base64 編碼會使郵件大小增加約 33%,因此您指定的值應該要比執行的實際郵件大小增加約 33%。 例如,若您指定的郵件大小上限值為 64 MB,則實際的郵件大小上限約為 48 MB。

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金鑰。 不過,套用至伺服器上所有網站的 maxAllowedContentLength 值會影響 ActiveSync 的訊息大小上限。 預設值為 30000000 個位元組。 若要查看 IIS 管理員中信箱伺服器上 ActiveSync 的這些值,請執行下列步驟:

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

    • 針對 [用戶端存取 (前端) 網站,開啟[IIS 管理員],流覽至 [網站>預設網站],然後選取[Microsoft-Server-ActiveSync]

    • 針對後端網站,開啟[IIS 管理員],流覽至[站> 台交換後端],然後選取[Microsoft-Server-ActiveSync]

  2. 確認底部已選取 [功能檢視] 索引標籤,然後按兩下 [管理] 區段中的 [組態編輯器]。

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

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

若要變更 maxAllowedContentLength 值,請輸入以位元組為單位的新值,然後按一下 [ 套用]。 您需要變更 Client Access 網站和後端網站上的值。

注意:您可以在 [網站>預設網站> 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 2 maxReceivedMessageSize="35000000" 個 HTTP 和 HTTPs 系結的 (實例) 位元組
後臺 %ExchangeInstallPath%ClientAccess\Owa\web.config 2 maxStringContentLength="35000000" 個 HTTP 和 HTTPs 系結的 (實例) 位元組

Outlook 網頁版限制的批註

  • 在後端 web.config 檔案中,您不需要修改MsOnlineShellService系結的值 maxStringContentLength="102400" 實例。

開始之前有哪些須知?

  • 預估完成時間:15 分鐘

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

  • 您儲存至web.config組態檔的變更會在您重新開機 IIS 之後套用。

  • 若要允許因為 Base64 編碼而增加 33% 的大小,請將您想要的新大小上限值乘以 4/3。 將值轉換為 KB (乘以 1024)。 若要將值轉換成位元組,請將 乘以 1048756 (1024*1024) 。 請注意,Base64 編碼所造成的大小增加可能大於 33%,且取決於數個因素 (例如,附件大小、檔案類型、壓縮,以及電子郵件用戶端) 。

  • 任何自訂的 Exchange 或 Internet Information Server (IIS) 您在 Exchange Server (上于 Exchange XML 應用程式組態檔中所做的設定,例如,當您安裝 Exchange CU 時, 將會覆寫 web.config檔案或EdgeTransport.exe.config檔案) 。 請務必儲存此資訊,以便在安裝之後輕鬆地重新套用設定。 安裝 Exchange CU 之後,您必須重新設定這些設定。

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

提示

有問題嗎? 在 Exchange 論壇中尋求協助。 請造訪論壇,網Exchange Server

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

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

    Notepad %ExchangeInstallPath%ClientAccess\exchweb\ews\web.config
    
    Notepad %ExchangeInstallPath%FrontEnd\HttpProxy\ews\web.config
    
  2. 如本主題稍早的資料表所述,在適當的web.config檔案中尋找相關金鑰。 例如,針對 EWS 用戶端,請在用戶端存取和後端中尋找 maxAllowedContentLength 金鑰web.config檔案,以及後端web.config檔案中所有 14 個值 maxReceivedMessageSize="67108864" 實例。

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

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

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

  4. 使用下列其中一種方法重新開機 Exchange 伺服器上的 IIS:

    • 開啟 [IIS 管理員],選取伺服器,然後在 [ 動作 ] 窗格中,按一下 [ 重新開機]

      在 [IIS 管理員] 中,選取伺服器,然後在 [動作] 窗格中,按一下 [重新開機]。

    • 從提升許可權的命令提示字元 (命令提示字元視窗執行下列命令,方法是選取 [ 以系統管理員身 分執行]) :

      net stop w3svc /y
      
      net start w3svc
      

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

您也可以從命令列設定用戶端特定的訊息大小限制,而不是使用記事本。 在 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 網頁版

%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。