方案: Exchange Online 中的条件邮件路由Scenario: Conditional mail routing in Exchange Online

有时可能需要根据邮件的收件人或发件人、邮件的发送位置、邮件的内容等因素以不同的方式路由邮件。There might be times you need to route mail differently depending on who the mail is sent to or from, where it's being sent, the contents of the message, and so on. 例如,如果在世界各地有多个网站,可能需要将邮件路由到特定网站。For example, if you have multiple sites around the world, you might want to route mail to a specific site. 您可以使用连接器和邮件流规则(也称为传输规则)执行此操作。You can do this using connectors and mail flow rules (also known as transport rules).

完成以下步骤后,邮件流规则将会把发送给 City 属性设置为 New Orleans 的用户的邮件重定向到出站连接器所指定的 IP 地址。When the steps below are completed, a mail flow rule will redirect messages addressed to users whose City property is set to New Orleans to the IP address specified by the Outbound connector.

第 1 步:使用 Exchange 管理中心创建连接器。Step 1: Use the Exchange admin center to create the connector

我们首先需要创建出站连接器。The first thing we need to do is create an Outbound connector. 此连接器将供我们在第 2 步中设置的邮件流规则使用。This connector will be used by the mail flow rule that we'll set up in Step 2. 在此连接器中,您将选择接收邮件的来源(如 Microsoft 365 或 Office 365 组织中的邮箱)、发送邮件的组织类型(如您的本地服务器)、应应用于连接的安全性以及目标服务器的名称或 IP 地址。In this connector, you'll select where messages it receives originate (such as a mailbox in your Microsoft 365 or Office 365 organization), the type of organization where the messages will be sent (such as your on-premises servers), the security that should be applied to the connection, and name or IP address of the target server. 若要了解有关如何创建连接器的详细信息,请参阅Configure mail flow using 连接器If you want to learn more about how to create connectors, check out Configure mail flow using connectors.

  1. 在 EAC 中,转到 "邮件流 > 连接器"。In the EAC, go to Mail flow > Connectors. 单击 "新建  添加" 图标 以创建新的连接器。click New Add Icon to create a new connector.

  2. 在" 发件人:"下拉框中,选择"Office 365"。In the From: drop-down box, choose Office 365.

  3. 如果想要连接到组织以外的服务器,请在" 收件人:"下拉框中,选择"组织的电子邮件服务器"或"合伙伙伴组织"。In the To: drop-down box, choose either Your organization's email server or Partner organization if you want to connect to a server other than your organizations.

    路由往来选项

  4. 命名该连接器并添加说明。如果想要立即打开连接器,请选中" 开启"。单击" 下一步"。Name the connector and add a description. If you want to turn the connector on immediately, check Turn it on. Click Next.

    为连接器命名

  5. 选择 "仅当我拥有传输规则 ... " 并单击 "下一步"。Choose Only when I have a transport rule... and click Next.

    传输规则选项

  6. 指定一个或多个 Microsoft 365 或 Office 365 将向其传递电子邮件的智能主机。Specify one or more smart hosts to which Microsoft 365 or Office 365 will deliver email messages.

    添加主机

  7. 根据安全需要定义传输层安全性 (TLS) 设置。Define your Transport Layer Security (TLS) settings depending on your security needs.

    定义 TLS 设置

  8. 查看新连接器配置并单击" 下一步"验证连接器。Review your new connector configurations and click Next to validate the connector.

第 2 步:使用 EAC 创建邮件流规则Step 2: Use the EAC to create a mail flow rule

至此,我们已创建连接器,接下来需要创建邮件流规则,以根据你定义的条件向连接器发送邮件。对于控制应何时将邮件发送到连接器,可以从很多条件中进行选择。Now that we've created a connector, we need to create a mail flow rule that'll send mail to it based on the criteria you define. There are many conditions you can select from to control when messages should be sent to the connector.

  1. 在 EAC 中,导航到 "邮件流" > 规则In the EAC, navigate to Mail flow > Rules. 单击 "新建  添加图标" ,然后选择 "新建规则 ..."。Click New Add Icon and choose Create a new rule....

  2. 在 "新建规则" 窗口中,对规则进行命名。In the New rule window, name the rule. 若要查看规则的所有可用选项,请单击页面底部的 "更多选项 ... "。To see all the options available for the rule, click More options... at the bottom of the page.

    单击其他选项

  3. 对于 " ** * 在以下情况应用此规则 ..." 中,选择收件人 ...** 并包含这些词语中的任何特定属性For *Apply this rule if..., select The recipient... and has specific properties including any of these words. 将显示“选择用户属性”框。The select user properties box appears. 单击 "  添加图标 ",然后在 "用户属性:" 下选择 " City"。Click Add Icon, and under User properties:, choose City. City是可供规则使用的 Active Directory 属性。City is an Active Directory attribute made available for use by the rule. 指定城市的名称,例如“新奥尔良”。Specify the name of the city, such as New Orleans. 单击“确定”,再次单击“确定”以关闭“选择用户属性”框。Click OK, and then click OK again to close the select user properties box.

    在以下情况应用规则

    重要

    在 Active Directory 中检查用户属性的准确性以确保邮件流规则按预期生效。 > 请注意,出站连接器更改可能需要一些时间才能复制。Check the accuracy of user attributes in Active Directory to ensure that the mail flow rule works as intended. > Note that outbound connector changes may take time to replicate.

  4. 对于** * "执行以下操作 ...",选择 "将邮件重定向到 ...** ",然后指定以下连接器For *Do the following..., choose Redirect the message to... and then specify the following connector. 将显示“选择连接器”框。The select connector box appears. 选择以前创建的出站连接器。Choose the Outbound connector you created previously.

    您可以选择规则的其他属性,例如测试模式和何时激活规则。You can choose additional properties for the rule, such as the test mode and when to activate the rule.

  5. 若要保存此连接器,单击" 保存"。To save the connector, click Save.