設定郵件流程規則的最佳作法Best practices for configuring mail flow rules

遵循下列最佳的作法是建議以 Exchange 傳輸規則以避免一般設定錯誤。每個建議的連結範例與逐步說明主題。Follow these best practice recommendations for Exchange transport rules in order to avoid common configuration errors. Each recommendation links to a topic with an example and step-by-step instructions.

測試您的規則Test your rules

若要確定人的電子郵件不會發生未預期的事情及以確定您真正會議商務、 法律或規範意願的您的規則,請務必徹底測試。有許多種和規則可以彼此互動,因此請務必測試您預期同時會符合規則和以防您不經意做過一般的規則不會符合規則的訊息。若要深入了解測試規則的所有選項,請參閱測試郵件流程規則To make sure unexpected things don't happen to people's email, and to make sure you're really meeting the business, legal, or compliance intentions of your rule, be sure to test it thoroughly. There are many options, and rules can interact with each other, so it's important to test messages that you expect both will match the rule and won't match the rule in case you inadvertently made a rule too general. To learn all the options for testing rules, see Test a mail flow rule.

您的規則的範圍Scope your rule

請確定您的規則只適用於您想要的訊息。例如:Make sure your rule applies only to the messages you intend it to. For example:

所有條件和例外狀況可用的傳輸規則的完整清單,請參閱:For a complete list of all the conditions and exceptions that are available for transport rules, see:

知道您需要兩個規則Know when you need two rules

有時延長執行您想要的這兩個規則。傳輸規則處理順序,讓多個規則可以套用至相同的訊息。例如,如果其中一個動作是要封鎖郵件,而且您也可以另一個您想要套用,例如將郵件複製到寄件者的管理員或變更的通知郵件主旨的動作就需要這兩個規則。第一個規則無法將郵件複製到寄件者的管理員及變更主旨及第二個規則可能封鎖郵件。Sometimes it takes two rules to do what you want. Transport rules are processed in order, so multiple rules can apply to the same message. For example, if one of the actions is to block the message, and you also have another action you'd like to apply, such as copying the message to the sender's manager or changing the subject for the notification message, you would need two rules. The first rule could copy the message to the sender's manager and change the subject, and the second rule could block the message.

如果您是使用類似的這兩個規則,請務必條件皆相同。若要查看範例,請查看範例 3 中常見的郵件核准案例,範例 3 中常見附件的郵件流程規則封鎖案例,以及整個組織的免責聲明、 簽章、 頁尾或標頭If you use two rules like this, be sure that the conditions are identical. To see examples, look at example 3 in Common message approval scenarios, example 3 in Common attachment blocking scenarios for mail flow rules, and Organization-wide disclaimers, signatures, footers, or headers.

不要重複上每個電子郵件交談中的動作Don't repeat an action on every email in a conversation

電子郵件交談中的鏈結可包含許多個別的郵件,並重複上每則訊息中之記錄的動作可能會取得惱人。例如,如果您有例如新增免責聲明的動作時,可能會想要僅適用於執行緒中第一封郵件。若是如此,新增例外狀況的已包含的免責聲明文字的郵件。如需範例,請參閱整個組織的免責聲明、 簽章、 頁尾或標頭The chain of email in a conversation can include many individual messages, and repeating the action on each message in the thread might get annoying. For example, if you have an action such as adding a disclaimer, you might want it to apply only to the first message in the thread. If so, add an exception for messages that already include the disclaimer text. For an example, see Organization-wide disclaimers, signatures, footers, or headers.

了解停止規則處理時間Know when to stop rule processing

有時它合理停止規則處理後可於符合規則。例如,如果您有一項規則封鎖附件的郵件,另一個符合模式的郵件中插入免責聲明,您可能應該停止規則處理後郵件會遭到封鎖。有不需要進一步的動作。Sometimes it makes sense to stop rule processing once a rule is matched. For example, if you have one rule to block messages with attachments and one to insert a disclaimer in messages that match a pattern, you probably should stop rule processing once the message is blocked. There's no need for further action.

若要停止規則處理之後會觸發規則,在 [規則] 中,選取 [停止處理其他規則] 核取方塊。To stop rule processing after a rule is triggered, in the rule, select the Stop processing more rules check box.

如果您有許多關鍵字] 或 [以符合模式時,會從檔案載入它們If you have lots of keywords or patterns to match, load them from a file

例如,您可能會想要防止如果它們包含無法接受或不正確的文字清單傳送電子郵件。您可以建立包含這些單字和片語的文字檔案並再使用 Windows PowerShell 設定使用這些郵件傳輸規則來封鎖。For example, you might want to prevent emails from being sent if they contain a list of unacceptable or bad words. You can create a text file containing these words and phrases, and then use Windows PowerShell to set up a transport rule that blocks messages that use them.

文字檔案可以包含規則運算式的模式。這些運算式不需區分大小寫。常見的規則運算式包括: The text file can contain regular expressions for patterns. These expressions are not case-sensitive. Common regular expressions include:

運算式Expression
相符項目Matches
.
任何單一字元Any single character
\*
任何其他字元Any additional characters
\d\d
任何十進位數字Any decimal digit
[ character_group ][ character_group ]
Character_group中任何單一字元。Any single character in character_group .

如範例顯示使用規則運算式與要使用的 Exchange 模組 Windows PowerShell 命令的文字檔案,請參閱使用路由傳送的單字、 片語或模式清單為基礎的電子郵件的郵件流程規則For an example that shows a text file with regular expressions and the Exchange module Windows PowerShell commands to use, see Use mail flow rules to route email based on a list of words, phrases, or patterns.

若要了解如何指定使用規則運算式模式,請參閱規則運算式參考 (英文)To learn how to specify patterns using regular expressions, see Regular Expression Reference.