smtp port 25 is blocked - need to unblock

Vahabudeen Pathiyampara 0 Reputation points
2025-04-21T15:07:30.0166667+00:00

Hi Team,

Please help unblock the port 25 (smtp) from the below vnets . vms in our vnets are not able to connect our smtp server on port 25 .

Please let us know if you need more info

Thank you

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,787 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Arko 2,220 Reputation points Microsoft External Staff Moderator
    2025-04-28T12:04:38.0366667+00:00

    Hello Vahabudeen Pathiyampara,

    In Azure, outbound SMTP traffic on TCP port 25 is blocked by default for most subscription types, including from VMs.

    This is confirmed in MS documentation-

    "The Azure platform blocks outbound SMTP connections on TCP port 25 for deployed VMs. This block is to ensure better security for Microsoft partners and customers, protect Microsoft's Azure platform, and conform to industry standards."

    Troubleshoot outbound SMTP connectivity in Azure Microsoft Learn

    enter image description here

    Even though Office 365 allows SMTP relay over port 25, Azure VMs cannot send unauthenticated email over port 25 unless certain conditions are met.

    How to fix it?

    Ans- You have two options-

    Option 1: Instead of port 25, you should configure your application or SMTP agent to use SMTP submission over port 587 with authentication.

    Microsoft officially recommends this method:

    "We recommend you use authenticated SMTP relay services to send email from Azure VMs. Connections to authenticated SMTP relay services are typically on TCP port 587 which isn't blocked."

    Troubleshoot outbound SMTP connectivity in Azure Microsoft Learn

    enter image description here

    enter image description here

    For Office 365 SMTP submission setup, Microsoft states:

    "Use SMTP AUTH client submission (Option 1) to send emails from devices or applications through Microsoft 365 or Office 365. SMTP AUTH uses TCP port 587."

    Set up SMTP client submission in Microsoft 365 | Microsoft Learn

    You can authenticate with an Office 365 licensed mailbox to relay emails securely.

    Option 2: If your Azure subscription is an Enterprise Agreement (EA) or Microsoft Customer Agreement for Enterprise (MCA-E) subscription, you can request to have the port 25 block removed.

    As per Microsoft document-

    "For VMs deployed in standard Enterprise Agreement or MCA-E subscriptions, the outbound SMTP connections on TCP port 25 aren't blocked."

    "To request to have the block removed, go to the Diagnose and Solve Problems section of the Virtual Network resource in the Azure portal and run the diagnostic."

    Troubleshoot outbound SMTP connectivity in Azure Microsoft Learn

    After the unblock request is approved, you must stop, deallocate, and restart the VM to apply the new network policies.

    Hope this clarifies your query.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.