在 Azure 中排查出站 SMTP 连接问题Troubleshoot outbound SMTP connectivity problems in Azure

从 2017 年 11 月 15 日开始,从虚拟机 (VM) 直接发送到外部域(例如 outlook.com)的出站电子邮件仅适用于 Azure 中的某些订阅类型。Starting on November 15, 2017, outbound email messages that are sent directly to external domains (like outlook.com) from a virtual machine (VM) are made available only to certain subscription types in Azure. 将阻止使用 TCP 端口 25 的出站 SMTP 连接。Outbound SMTP connections that use TCP port 25 were blocked. (端口 25 主要用于未经身份验证的电子邮件传递。)(Port 25 is used mainly for unauthenticated email delivery.)

此行为更改仅适用于在 2017 年 11 月 15 日之后创建的订阅和部署。This change in behavior applies only to subscriptions and deployments that were created after November 15, 2017.

建议使用经过身份验证的 SMTP 中继服务从 Azure VM 或 Azure 应用服务发送电子邮件。We recommend you use authenticated SMTP relay services to send email from Azure VMs or from Azure App Service. (这些中继服务通常通过 TCP 端口 587 连接,但它们支持其他端口。)这些服务用于维护 IP 或域信誉,以尽量降低第三方电子邮件提供商拒绝邮件的可能性。(These relay services typically connect through TCP port 587, but they support other ports.) These services are used to maintain IP or domain reputation to minimize the possibility that third-party email providers will reject messages. SendGrid 就是这样一个 SMTP 中继服务,但还有其他服务。SendGrid is one such SMTP relay service, but there are others. 还可具有本地运行并能使用的安全的 SMTP 中继服务。You might also have a secure SMTP relay service running on-premises that you can use.

在 Azure 中使用这些电子邮件传递服务不受限制(无论是哪种订阅类型)。Using these email delivery services isn't restricted in Azure, regardless of the subscription type.

企业协议Enterprise Agreement

企业协议 Azure 用户仍然无需使用经身份验证的中继便可发送电子邮件。For Enterprise Agreement Azure users, there's no change in the technical ability to send email without using an authenticated relay. 新的和现有的企业协议用户均可以尝试从 Azure VM 直接向外部电子邮件提供商发送出站电子邮件,且没有任何 Azure 平台限制。Both new and existing Enterprise Agreement users can try outbound email delivery from Azure VMs directly to external email providers without any restrictions from the Azure platform. 不保证电子邮件提供商会接受来自任何给定用户的传入电子邮件。There's no guarantee that email providers will accept incoming email from any given user. 但是,Azure 平台不会阻止企业协议订阅中针对 VM 的交付尝试。But the Azure platform won't block delivery attempts for VMs within Enterprise Agreement subscriptions. 必须直接与电子邮件提供商接洽,以修复涉及特定提供商的各项邮件发送或垃圾邮件筛选问题。You'll have to work directly with email providers to fix any message delivery or SPAM filtering problems that involve specific providers.

标准预付费套餐Standard Pay-in-Advance Offer

如果你已在 2017 年 11 月 15 日前注册标准预付费套餐订阅,那么从技术上来说,你仍然能够尝试发送出站电子邮件。If you signed up before November 15, 2017, for a Standard Pay-in-Advance Offer subscription, there will be no change in your technical ability to try outbound email delivery. 你仍然能够尝试从这些订阅中的 Azure VM 直接向外部电子邮件提供商发送出站电子邮件,而且不存在任何 Azure 平台限制。You'll still be able to try outbound email delivery from Azure VMs within these subscriptions directly to external email providers without any restrictions from the Azure platform. 同样地,不保证电子邮件提供商会接受来自任何给定用户的传入电子邮件。Again, there's no guarantee that email providers will accept incoming email from any given user. 用户必须直接与电子邮件提供商接洽,以修复涉及特定提供商的各项邮件发送或垃圾邮件筛选问题。Users will have to work directly with email providers to fix any message delivery or SPAM filtering issues that involve specific providers.

对于在 2017 年 11 月 15 日之后创建的标准预付费套餐订阅,存在一些技术限制,它们会阻止从订阅中的 VM 直接发送电子邮件。For Standard Pay-in-Advance Offer subscriptions that were created after November 15, 2017, there will be technical restrictions that block email that's sent directly from VMs within the subscriptions. 如果希望能够将来自 Azure VM 的电子邮件直接发送给外部电子邮件提供商(不使用经过身份验证的 SMTP 中继),并且你的帐户具有良好的付款历史记录,那么你可请求删除限制。If you want to be able to send email from Azure VMs directly to external email providers (without using an authenticated SMTP relay) and you have an account in good standing with a payment history, you can request to have the restriction removed. 世纪互联会根据自己的判断审批请求,并且只会在执行额外的防欺诈检查后才授予权限。Requests will be reviewed and approved at 21Vianet's discretion, and they'll be granted only after additional anti-fraud checks are made. 若要提交请求,请使用以下支持类型开启一个支持案例:订阅管理 服务类型:维护通知相关问题To make a request, open a support case by using the following support type: Subscription Management service type: Maintenance notification related issue. 请确保添加详细信息,解释为什么要直接向电子邮件提供商发送邮件而不是使用经身份验证的中继。Make sure that you add details about why your deployment has to send mail directly to mail providers instead of using an authenticated relay.

在 Azure 门户中豁免标准预付费套餐订阅并停止再重启 VM 后,该订阅中的所有 VM 在此后都会被豁免。After a Standard Pay-in-Advance Offer subscription is exempted and the VMs are stopped and restarted in the Azure portal, all VMs in that subscription are exempted going forward. 该豁免仅适用于请求的订阅,并且仅适用于直接路由到 Internet 的 VM 流量。The exemption applies only to the subscription requested and only to VM traffic that's routed directly to the internet.

备注

Azure 保留在确定发生违反服务条款的情况下撤销这些豁免的权利。Azure reserves the right to revoke these exemptions if it's determined that a violation of terms of service has occurred.

MSDN、Azure Pass、Azure 开放许可、教育、面向学生的 Azure、Visual Studio 和试用版MSDN, Azure Pass, Azure in Open, Education, Azure for Students, Visual Studio, and Trial

如果你在 2017 年 11 月 15 日之后创建了以下订阅类型之一,则将存在技术限制,它们会阻止从订阅中的 VM 直接发送给电子邮件提供商的电子邮件:If you created one of the following subscription types after November 15, 2017, you'll have technical restrictions that block email that's sent from VMs within the subscription directly to email providers:

  • MSDNMSDN
  • Azure PassAzure Pass
  • Azure 开放许可Azure in Open
  • 教育Education
  • 面向学生的 AzureAzure for Students
  • 试用Trial
  • 任何 Visual Studio 订阅Any Visual Studio subscription

此限制是为了防止滥用邮件。The restrictions are in place to prevent abuse. 不接受去除这些限制的请求。Requests to remove these restrictions won't be granted.

如果你正在使用这些订阅类型,建议使用 SMTP 中继服务(如本文前面部分所述),或者更改订阅类型。If you're using these subscription types, we encourage you to use SMTP relay services, as outlined earlier in this article, or to change your subscription type.

云解决方案提供商Cloud Solution Provider

如果你正在通过云解决方案提供商使用 Azure 资源,则可在 Azure 支持站点中请求删除限制。If you're using Azure resources through a Cloud Solution Provider, you can make a request to remove the restriction in Azure support site. 如果你的请求被接受,你的订阅将被启用,或者你将收到后续步骤的说明。If your request is accepted, your subscription will be enabled or you'll receive instructions for next steps.

Azure 合作伙伴网络、BizSpark Plus 或 Azure 赞助Azure Partner Network, BizSpark Plus, or Azure Sponsorship

对于在 2017 年 11 月 15 日之后创建的以下类型的订阅,将存在一些技术限制,它们会阻止订阅中的 VM 直接发送电子邮件:For subscriptions of the following types that were created after November 15, 2017, there will be technical restrictions that block email that's sent directly from VMs within the subscriptions:

  • Azure 合作伙伴网络 (MPN)Azure Partner Network (MPN)
  • BizSpark PlusBizSpark Plus
  • Azure 赞助Azure Sponsorship

如果希望能够将来自 Azure VM 的电子邮件直接发送给外部电子邮件提供商(不使用经过身份验证的 SMTP 中继),可使用以下问题类型打开支持案例来发出请求:“技术” > “虚拟网络” > “连接”>“网络连接问题”,并在“标题”字段中键入“无法发送电子邮件(SMTP/端口 25)” 。If you want to be able to send email from Azure VMs directly to external email providers (without using an authenticated SMTP relay), you can make a request by opening a support case by using the following issue type: Technical > Virtual Network > Connectivity > ** Network connectivity problems **, and type Cannot send email (SMTP/Port 25) in Title field. 请务必添加详细信息,解释你的部署为什么需要向邮件直接发送给电子邮件提供商,而不使用经过身份验证的中继。Be sure to add details about why your deployment has to send mail directly to mail providers instead of using an authenticated relay. 请求将由 Microsoft 自行决定审查和审批。Requests will be reviewed and approved at the discretion of Microsoft. 只有在完成其他反欺诈检查后,才能授予请求。Requests will be granted only after additional antifraud checks are completed.

在 Azure 门户中豁免订阅并停止再重启 VM 后,该订阅中的所有 VM 在此后都会被豁免。After a subscription is exempted and the VMs have been stopped and restarted in the Azure portal, all VMs in that subscription are exempted going forward. 该豁免仅适用于请求的订阅,并且仅适用于直接路由到 Internet 的 VM 流量。The exemption applies only to the subscription requested and only to VM traffic that's routed directly to the internet.

需要帮助?Need help? 联系支持人员Contact support

如果仍需帮助,请联系支持人员,以快速解决问题。If you still need help, contact support to get your problem resolved quickly. 使用此问题类型:“技术” > “虚拟网络” > “连接”>“网络连接问题”,并在“标题”字段中键入“无法发送电子邮件(SMTP/端口 25)” 。Use this issue type: Technical > Virtual Network > Connectivity > ** Network connectivity problems **, and type Cannot send email (SMTP/Port 25) in Title field.