在 Exchange Online 中为子域启用邮件流Enable mail flow for subdomains in Exchange Online

如果您有混合环境,托管邮箱同时在 Exchange Online 和本地和您的本地环境中有仅存在的接受域的子域,您可以启用电子邮件流与这些本地子域。例如,如果您具有名为 Contoso.com 的接受的域,并启用的匹配子域,用户可以发送电子邮件,或从 Contoso.com 的内部部署环境,如 marketing.contoso.com 中存在的所有子域中接收电子邮件和nwregion.contoso.com。 在 Microsoft Forefront Online Protection for Exchange (FOPE),此功能称为 catch-all 域。If you have a hybrid environment, with mailboxes hosted both in Exchange Online and on-premises, and you have subdomains of the accepted domains that only exist in your on-premises environment, you can enable email flow to and from these on-premises subdomains. For example, if you have an accepted domain called Contoso.com, and you enable match subdomains, users can send email to, or receive email from all subdomains of Contoso.com that exist in your on-premises environment, such as marketing.contoso.com and nwregion.contoso.com. In Microsoft Forefront Online Protection for Exchange (FOPE), this feature was called catch-all domains.

重要

如果您具有有限的子域,并知道所有子域的名称,建议每个子域设置为接受域通过使用 Office 365 管理中心中,而不是使用本主题中的过程。通过单独设置每个子域,可以具有更好地控制邮件流,并包括每个子域的唯一的传输规则。有关在 Office 365 管理中心添加域的详细信息,请参阅添加到 Office 365 域。>> 才能启用匹配子域,请接受的域必须设置为内部中继。有关将域类型设置为内部中继的信息,请参阅管理接受域在 Exchange Online。>> 启用匹配子域,顺序将为所有子域的邮件传递到您的组织的电子邮件服务器 (外部 Office 365 中),该服务之后则还必须更改的出站连接器。有关说明,请参阅使用 EAC 将添加到您的出站连接器的域If you have a limited number of subdomains, and know all the subdomain names, we recommend setting up each subdomain as an accepted domain by using the Office 365 admin center, rather than using the procedures in this topic. By setting up each subdomain separately, you can have finer control over mail flow, and include unique transport rules for each subdomain. For more information about adding a domain in the Office 365 admin center, see Add your domain to Office 365. > > In order to enable match subdomains, an accepted domain must be set up as an internal relay. For information about setting the domain type to internal relay, see Manage accepted domains in Exchange Online. > > After you enable match subdomains, in order for the service to deliver mail for all subdomains to your organization's email server (outside Office 365), you must also change the outbound connector. For instructions, see Use the EAC to add the domain to your outbound connector.

在开始之前,您需要知道什么?What do you need to know before you begin?

  • 估计完成时间:5 分钟Estimated time to complete: 5 minutes

  • 您需要执行此过程之前为其分配权限。若要查看所需的权限,请参阅的功能权限在 Exchange Online主题中的"域"条目。You need to be assigned permissions before you can perform this procedure or procedures. To see what permissions you need, see the "Domains" entry in the Feature permissions in Exchange Online topic.

  • 若要了解可能适用于此主题中过程的键盘快捷键,请参阅 Exchange 管理中心内的键盘快捷键For information about keyboard shortcuts that may apply to the procedures in this topic, see Keyboard shortcuts in the Exchange admin center.

提示

有问题?寻求帮助 Exchange 论坛。访问在Exchange ServerExchange OnlineExchange Online Protection论坛。Having problems? Ask for help in the Exchange forums. Visit the forums at Exchange Server,Exchange Online, or Exchange Online Protection.

希望执行何种操作What Do You Want to Do

使用 EAC 设置域上的匹配子域Use the EAC to set up match subdomains on a domain

  1. 在 EAC 中,转到邮件流 > 接受域,然后选择域。In the EAC, go to Mail Flow > Accepted domains, and select the domain.

  2. 确认已选中内部中继Verify that Internal Relay is selected.

  3. 选择发送和接收电子邮件此域的匹配子域Select Match subdomains for this domain for sending and receiving emails.

使用 EAC 将域添加到您的出站连接器Use the EAC to add the domain to your outbound connector

  1. 在 EAC 中,转到邮件流 > 连接器In the EAC, go to Mail Flow > Connectors.

  2. 出站连接器下选择您的组织的电子邮件服务器的连接器,然后选择编辑编辑图标Under Outbound Connectors, select the connector for your organization's email server, and then select EditEdit icon.

  3. 选择范围,,然后选择下列选项之一:Select Scope, and then select one of the following:

    • 选择路由通过此连接器的所有接受的域Select Route all accepted domains through this connector.

    • 收件人域部分中,选择新建添加图标。在添加域框中,输入您为其启用匹配子域的域的通配符域条目。例如,如果您启用了 contoso.com 的匹配子域,输入*。 contonso.com 作为的收件人的域。In the Recipient domains section, select NewAdd Icon. In the Add domain box, enter a wildcard domain entry for the domain for which you enabled match subdomains. For example, if you enabled match subdomains for contoso.com, enter *.contonso.com as a recipient domain.

备注

如果尚不没有的出站连接器,请参阅配置邮件流,使用 Office 365 中的连接器If you don't yet have an outbound connector, see Configure mail flow using connectors in Office 365.

使用 Exchange 命令行管理程序设置域上的匹配子域Use the Exchange Management Shell to set up match subdomains on a domain

若要向设置为内部中继的域添加匹配子域,请使用以下语法:To add match subdomains to a domain that is set up as an internal relay, use this syntax

Set-AcceptedDomain -Identity <Domain Name> -MatchSubdomains $true 

本示例为 contoso.com 域设置匹配子域。This example sets up match subdomains for the contoso.com domain.

Set-AcceptedDomain -Identity contoso.com -MatchSubdomains $true 

有关使用 Exchange 命令行管理程序的详细信息,请参阅Set-accepteddomainPowerShell in Exchange Online ProtectionFor more information about using the Exchange Management Shell, see set-AcceptedDomain and PowerShell in Exchange Online Protection.

您如何知道这有效?How do you know this worked?

若要验证已成功为域使用 Exchange 命令行管理程序中添加匹配子域,请执行以下操作:To verify that you successfully added match subdomains to a domain using the Exchange Management Shell, do the following:

  1. 运行命令Get-RemoteDomain <Domain Name> | Format-List以验证_MatchSubdomains_设置。Run the command Get-RemoteDomain <Domain Name> | Format-List to verify the MatchSubdomains setting.