Exchange Online 中的郵件流程規則 (傳輸規則)Mail flow rules (transport rules) in Exchange Online

您可以使用 [郵件流程規則 (也稱為傳輸規則) 來識別和流程透過 Office 365 組織的郵件採取動作。郵件流程規則就類似於 Outlook 和網路上的 Outlook 中可用的收件匣規則。主要差異在於郵件流程規則採取動作的郵件不斷活躍傳輸,並不之後將郵件傳遞至信箱。郵件流程規則包含更豐富的條件、 例外狀況和動作] 設定可提供讓您實作許多類型的郵件原則的彈性。You can use mail flow rules (also known as transport rules) to identify and take action on messages that flow through your Office 365 organization. Mail flow rules are similar to the Inbox rules that are available in Outlook and Outlook on the web. The main difference is mail flow rules take action on messages while they're in transit, and not after the message is delivered to the mailbox. Mail flow rules contain a richer set of conditions, exceptions, and actions, which provides you with the flexibility to implement many types of messaging policies.

本文說明郵件流程規則的元件它們的運作方式This article explains the components of mail flow rules, and how they work.

如需的步驟來建立、 複製及管理郵件流程規則,請參閱管理郵件流程規則。針對每個規則,您必須強制執行其、 測試,或測試和通知寄件者的選項。若要深入了解測試的選項,請參閱Test mail flow 規則原則提示For steps to create, copy, and manage mail flow rules, see Manage mail flow rules. For each rule, you have the option of enforcing it, testing it, or testing it and notifying the sender. To learn more about the testing options, see Test a mail flow rule and Policy Tips.

如需符合郵件流程規則之訊息的摘要和詳細報告,請參閱 Use mail protection reports in Office 365 to view data about malware, spam, and rule detectionsFor summary and detail reports about messages that matched mail flow rules, see Use mail protection reports in Office 365 to view data about malware, spam, and rule detections.

若要使用郵件流程規則實作特定的訊息原則,請參閱下列主題︰To implement specific messaging policies by using mail flow rules, see these topics:

郵件流程規則元件Mail flow rule components

郵件流程規則是由條件、例外狀況、動作和屬性所組成︰A mail flow rule is made of conditions, exceptions, actions, and properties:

  • 條件識別您要套用至動作的訊息。某些狀況檢查郵件標頭欄位 (例如 [收件者、、 或 [副本] 欄位)。其他條件會檢查郵件內容 (例如,郵件主旨、 body、 附件、 郵件大小或郵件分類)。大部分的情況需要您指定的比較運算子 (例如等於、 不等於或包含) 和要比對的值。如果沒有任何條件或例外狀況,規則會套用到所有郵件。Conditions Identify the messages that you want to apply the actions to. Some conditions examine message header fields (for example, the To, From, or Cc fields). Other conditions examine message properties (for example, the message subject, body, attachments, message size, or message classification). Most conditions require you to specify a comparison operator (for example, equals, doesn't equal, or contains) and a value to match. If there are no conditions or exceptions, the rule is applied to all messages.

    如需關於郵件流程規則條件在 Exchange Online,請參閱[Mail flow 規則條件和例外狀況 (述詞) 在 Exchange OnlineFor more information about mail flow rule conditions in Exchange Online, see Mail flow rule conditions and exceptions (predicates) in Exchange Online.

  • 例外狀況(選用) 確認動作不應該套用至郵件。條件中可用的相同訊息識別碼也都可以在例外狀況。例外條件會覆寫和即使在郵件符合所有已設定條件的防止從套用至郵件的規則動作。Exceptions Optionally identify the messages that the actions shouldn't apply to. The same message identifiers that are available in conditions are also available in exceptions. Exceptions override conditions and prevent the rule actions from being applied to a message, even if the message matches all of the configured conditions.

  • 動作指定要執行相符的規則條件,並不符合任何例外狀況的郵件項目。有可用許多動作,例如拒絕、 刪除或重新導向郵件,加入其他收件者、 新增前置字元的郵件主旨或郵件內文中插入免責聲明。Actions Specify what to do to messages that match the conditions in the rule, and don't match any of the exceptions. There are many actions available, such as rejecting, deleting, or redirecting messages, adding additional recipients, adding prefixes in the message subject, or inserting disclaimers in the message body.

    如需詳細資訊的郵件流程,可用在 Exchange Online 的規則動作,請參閱規則動作在 Exchange Online 的郵件流程For more information about mail flow rule actions that are available in Exchange Online, see Mail flow rule actions in Exchange Online.

  • 屬性指定不條件、 例外狀況或執行其他規則設定。例如,當此規則應套用,是否要強制執行或測試規則,以及何時規則發生作用的時段。Properties Specify other rules settings that aren't conditions, exceptions or actions. For example, when the rule should be applied, whether to enforce or test the rule, and the time period when the rule is active.

    如需詳細資訊,請參閱本主題中的郵件流程規則屬性一節。For more information, see the Mail flow rule properties section in this topic.

多個條件、例外狀況和動作Multiple conditions, exceptions, and actions

下表顯示規則中如何處理多個條件、條件值、例外狀況和動作。The following table shows how multiple conditions, condition values, exceptions, and actions are handled in a rule.

元件Component 邏輯Logic 註解Comments
多個條件Multiple conditions
ANDAND
郵件必須符合規則中的所有條件。如果您需要符合一個條件或另一個條件,請對每一個條件使用不同的規則。例如,若要將相同的免責聲明新增至附件和內容包含特定文字的郵件,請為每一個條件建立一個規則。在 EAC 中,您可以輕易地複製規則。A message must match all the conditions in the rule. If you need to match one condition or another, use separate rules for each condition. For example, if you want to add the same disclaimer to messages with attachments and messages that contain specific text, create one rule for each condition. In the EAC, you can easily copy a rule.
具有多個值的一個條件One condition with multiple values
OROR
某些狀況允許您指定多個值。郵件必須符合其中任何一個 (不是所有) 指定值。例如,如果電子郵件有主旨股票價格資訊,而且主旨包含任何這些字詞條件設定以符合文字 Contoso 或股票、 條件滿足因為主旨包含至少其中一個指定的值。Some conditions allow you to specify more than one value. The message must match any one (not all) of the specified values. For example, if an email message has the subject Stock price information, and the The subject includes any of these words condition is configured to match the words Contoso or stock, the condition is satisfied because the subject contains at least one of the specified values.
多個例外狀況Multiple exceptions
OROR
如果郵件符合任何例外狀況,則動作不會套用到郵件。郵件不必符合所有例外狀況。If a message matches any one of the exceptions, the actions are not applied to the message. The message doesn't have to match all the exceptions.
多個動作Multiple actions
ANDAND
符合的規則條件的郵件會取得所有規則中指定的動作。例如,如果前面加上的郵件的主旨[密件副本] 方塊中新增收件者的動作會選取這兩個動作將會套用至郵件。Messages that match a rule's conditions get all the actions that are specified in the rule. For example, if the actions Prepend the subject of the message with and Add recipients to the Bcc box are selected, both actions are applied to the message.
請記住,某些動作 (例如,[刪除郵件而不通知任何人] 動作) 會阻止後續規則套用至郵件。其他動作 (例如 [轉寄郵件]) 則不允許額外的動作。Keep in mind that some actions, such as the Delete the message without notifying anyone action, prevent subsequent rules from being applied to a message. Other actions such as Forward the message do not allow additional actions.
您也可以在規則上設定動作,以便在套用該規則時,不要將後續的規則套件到郵件。You can also set an action on a rule so that when that rule is applied, subsequent rules are not applied to the message.

郵件流程規則屬性Mail flow rule properties

下表說明郵件流程規則中可用的規則屬性。The following table describes the rule properties that are available in mail flow rules.

EAC 中的屬性名稱Property name in the EAC 在 PowerShell 中的參數名稱Parameter name in PowerShell 描述Description
優先順序Priority
優先順序Priority
表示規則套用到郵件的順序。預設優先順序是以規則的建立時間為基礎 (較舊規則的優先順序高於較新的規則,而較高優先順序的規則會在較低優先順序的規則之前處理)。Indicates the order that the rules are applied to messages. The default priority is based on when the rule is created (older rules have a higher priority than newer rules, and higher priority rules are processed before lower priority rules).
您可以變更在 EAC 的規則優先順序依向上或向下移動之規則的規則清單中。在 PowerShell 中,您可以設定優先順序數字 (0 為最高優先順序)。You change the rule priority in the EAC by moving the rule up or down in the list of rules. In the PowerShell, you set the priority number (0 is the highest priority).
例如,如果您有一項規則以拒絕包括信用卡號,與另一個要求核准的郵件,將要拒絕規則發生第一次,並停止套用其他規則。For example, if you have one rule to reject messages that include a credit card number, and another one requiring approval, you'll want the reject rule to happen first, and stop applying other rules.
如需詳細資訊,請參閱設定郵件流程規則的優先順序For more information, see Set the priority of a mail flow rule.
ModeMode
ModeMode
您可以指定是否要讓規則立即開始處理郵件,或您是否想要測試規則,而不影響郵件傳遞 (不論是否有資料遺失防護或 DLP 原則提示)。You can specify whether you want the rule to start processing messages immediately, or whether you want to test rules without affecting the delivery of the message (with or without Data Loss Prevention or DLP Policy Tips).
原則提示呈現在 Outlook 或 Outlook 會建立郵件的人而言提供可能原則違規的相關資訊的網路上的簡短附註。如需詳細資訊,請參閱 <原則提示Policy Tips present a brief note in Outlook or Outlook on the web that provides information about possible policy violations to the person that's creating the message. For more information, see Policy Tips.
如需模式的詳細資訊,請參閱<Test a mail flow rule>。For more information about the modes, see Test a mail flow rule.
於下列日期啟用此規則Activate this rule on the following date
於下列日期停用此規則Deactivate this rule on the following date
ActivationDateActivationDate
ExpiryDateExpiryDate
指定規則的有效日期範圍。Specifies the date range when the rule is active.
在 [上] 核取方塊選取或未選取On check box selected or not selected
新的規則: New-transportrule指令程式上的_Enabled_參數。New rules: Enabled parameter on the New-TransportRule cmdlet.
現有規則:使用 Enable-TransportRuleDisable-TransportRule Cmdlet。Existing rules: Use the Enable-TransportRule or Disable-TransportRule cmdlets.
此值會顯示在規則的 State 屬性中。The value is displayed in the State property of the rule.
您可以建立已停用的規則,而在您準備進行測試時加以啟用。或者,您可以在不刪除規則的情況下進行停用,以保留設定。You can create a disabled rule, and enable it when you're ready to test it. Or, you can disable a rule without deleting it to preserve the settings.
如果無法完成規則處理時便順延郵件Defer the message if rule processing doesn't complete
RuleErrorActionRuleErrorAction
您可以指定如果無法完成規則處理時,應該如何處理郵件。預設會忽略此規則,但您可以選擇重新提交郵件進行處理。You can specify how the message should be handled if the rule processing can't be completed. By default, the rule will be ignored, but you can choose to resubmit the message for processing.
符合郵件中的寄件者地址Match sender address in message
SenderAddressLocationSenderAddressLocation
如果此規則使用可檢查寄件者電子郵件地址的條件或例外狀況,您可以查看郵件標頭、郵件信封或這兩者的值。If the rule uses conditions or exceptions that examine the sender's email address, you can look for the value in the message header, the message envelope, or both.
停止處理其他規則Stop processing more rules
SenderAddressLocationSenderAddressLocation
這是適用於規則的動作,但它看起來像是 EAC 中的屬性。您可以選擇在規則處理郵件之後,停止將其他規則套用至郵件。This is an action for the rule, but it looks like a property in the EAC. You can choose to stop applying additional rules to a message after a rule processes a message.
註解Comments
註解Comments
您可以輸入有關規則的描述性註解。You can enter descriptive comments about the rule.

郵件流程規則套用至訊息的方式How mail flow rules are applied to messages

透過您的組織流程的所有訊息會都評估對您組織中已啟用的郵件流程規則。郵件流程上所列順序處理規則>規則] 頁面上的 EAC 中,或根據 PowerShell 的對應_Priority_參數值。All messages that flow through your organization are evaluated against the enabled mail flow rules in your organization. Rules are processed in the order listed on the Mail flow > Rules page in EAC, or based on the corresponding Priority parameter value in the PowerShell.

每個規則也提供選項可於符合規則時停止處理其他規則。對於符合多個郵件流程規則中條件的郵件而言,此設定很重要 (您想要將哪個規則套用到郵件?全部?僅只一個?)。Each rule also offers the option of stopping processing more rules when the rule is matched. This setting is important for messages that match the conditions in multiple mail flow rules (which rule do you want applied to the message? All? Just one?).

郵件類型引發的處理差異Differences in processing based on message type

通過組織的郵件有幾種類型。下表顯示郵件流程規則可處理的郵件類型。There are several types of messages that pass through an organization. The following table shows which messages types can be processed by mail flow rules.


郵件類型Type of message 可以套用規則嗎?Can a rule be applied?
一般郵件包含單一 rtf 格式 (RTF)、 HTML 或純文字郵件內文或 multipart 或另一組郵件郵件內文。Regular messages Messages that contain a single rich text format (RTF), HTML, or plain text message body or a multipart or alternative set of message bodies.
Yes
* * Office 365 郵件加密 * * 加密的 Office 365 中的 Office 365 郵件加密的郵件。如需詳細資訊,請參閱Office 365 郵件加密**Office 365 Message Encryption ** Messages encrypted by Office 365 Message Encryption in Office 365. For more information, see Office 365 Message Encryption.
規則永遠可以存取信封標頭,並根據可檢查這些標頭的條件來處理郵件。Rules can always access envelope headers and process messages based on conditions that inspect those headers.
若要讓規則檢查或修改已加密郵件的內容,您需要確認該傳輸解密已啟用 (強制或選用 ; 預設值是選擇性)。如需詳細資訊,請參閱啟用或停用傳輸解密For a rule to inspect or modify the contents of an encrypted message, you need to verify that transport decryption is enabled (Mandatory or Optional; the default is Optional). For more information, see Enable or disable transport decryption.
您也可以建立規則以自動解密加密的郵件。如需詳細資訊,請參閱Define rules 加密或解密電子郵件訊息You can also create a rule that automatically decrypts encrypted messages. For more information, see Define rules to encrypt or decrypt email messages.
S/MIME 加密的郵件S/MIME encrypted messages
規則只可以存取信封標頭,並根據可檢查這些標頭的條件來處理郵件。Rules can only access envelope headers and process messages based on conditions that inspect those headers.
無法處理具有需要檢查郵件內容之條件的規則,或具有可以修改郵件內容之動作的規則。Rules with conditions that require inspection of the message's content, or actions that modify the message's content can't be processed.
RMS 受保護的郵件具有 Active Directory Rights Management Services (AD RMS) 或 Azure 版權管理 (RMS) 原則套用的郵件。RMS protected messages Messages that had an Active Directory Rights Management Services (AD RMS) or Azure Rights Management (RMS) policy applied.
規則永遠可以存取信封標頭,並根據可檢查這些標頭的條件來處理郵件。Rules can always access envelope headers and process messages based on conditions that inspect those headers.
若要讓規則檢查或修改 RMS 保護之郵件的內容,您需要確認該傳輸解密已啟用 (強制或選用 ; 預設值是選擇性)。如需詳細資訊,請參閱啟用或停用傳輸解密For a rule to inspect or modify the contents of an RMS protected message, you need to verify that transport decryption is enabled (Mandatory or Optional; the default is Optional). For more information, see Enable or disable transport decryption.
明文簽章的郵件已簽署但未加密的郵件。Clear-signed messages Messages that have been signed but not encrypted.
Yes
UM 訊息郵件會建立或處理的整合通訊服務,如語音信箱、 傳真、 未接的來電通知和訊息建立或轉寄使用 Microsoft Outlook 語音存取。UM messages Messages that are created or processed by the Unified Messaging service, such as voice mail, fax, missed call notifications, and messages created or forwarded by using Microsoft Outlook Voice Access.
Yes
匿名的郵件匿名寄件者所傳送的郵件。Anonymous messages Messages sent by anonymous senders.
Yes
讀取報告所產生的讀取回條要求的回應的寄件者的報告。讀取報告具有郵件類別的IPM.Note*.MdnReadIPM.Note*.MdnNotReadRead reports Reports that are generated in response to read receipt requests by senders. Read reports have a message class of IPM.Note*.MdnRead or IPM.Note*.MdnNotRead.
Yes

其他注意事項What else should I know?

  • 規則的版本RuleVersion屬性值不是 Exchange Online 中的重要的。The Version or RuleVersion property value for a rule isn't important in Exchange Online.

  • 在建立或修改郵件流程規則之後,可能需要 30 分鐘,以將新規則或更新的規則套用至訊息。After you create or modify a mail flow rule, it can take up to 30 minutes for the new or updated rule to be applied to messages.

相關資訊For more information

管理郵件流程規則Manage mail flow rules

使用檢查 Office 365 中的郵件附件的郵件流程規則Use mail flow rules to inspect message attachments in Office 365

整個組織的免責聲明、 簽章、 頁尾或標頭Organization-wide Disclaimers, Signatures, Footers, or Headers

管理郵件核准Manage message approval

郵件流程規則程序在 Exchange OnlineMail flow rule procedures in Exchange Online

Transport and Inbox rule limitsTransport and Inbox rule limits