Table of Contents:

If you are looking for sending e-mails through your Virtual Machine Instances you would be disappointed by reading this blog.

Here is what we got from all the sites like Amazon AWS, Google Cloud, Microsoft Azure & Vultr that they are blocking the port 25 by default or have certain restrictions:

 

Amazon AWS:

Source:

https://aws.amazon.com/premiumsupport/knowledge-center/ec2-port-25-throttle/

How do I remove the restriction on port 25 from my Amazon EC2 instance or AWS Lambda function? AWS blocks outbound traffic on port 25 (SMTP) of all EC2 instances and Lambda functions by default. If you want to send outbound traffic on port 25, you can request for this restriction to be removed. To remove the port 25 restriction on your Lambda function, associate your function with an Amazon VPC. Then, give internet access to your Lambda function using a network address translation (NAT) gateway. The port 25 restriction can’t be removed from non-VPC functions.

 

Google Cloud Platform:

Source:

https://cloud.google.com/compute/docs/tutorials/sending-mail

Sending email from an instance Due to the risk of abuse, connections to destination TCP Port 25 are always blocked when the destination is external to your VPC network. This includes using SMTP relay with Google Workspace.  

Google Cloud Platform even discourages direct use of port 25 and email service usage from Virtual Machine Instance and recommending third party services like MailGun, SendGrid, this seems disappointing.

Choosing an email service to use SendGrid, Mailgun, and Mailjet offer a free tier for Compute Engine customers to set up and send email through their servers. If you don’t have a Google Workspace account, use these third-party partners to take advantage of features like click tracking, analytics, APIs, and other features to meet your email needs.

 

Microsoft Azure:

Here is what Microsoft Azure has to say about port 25:

Source:

https://docs.microsoft.com/en-us/azure/virtual-network/troubleshoot-outbound-smtp-connectivity

Troubleshoot outbound SMTP connectivity problems in Azure Outbound email messages that are sent directly to external domains (like outlook.com and gmail.com) on TCP port 25 from a virtual machine (VM) is possible only when the VM is deployed in certain subscription types.   Important For all examples below, the process applies only to Virtual Machines & VM Scale Sets resources (Microsoft.Compute/virtualMachines & Microsoft.Compute/virtualMachineScaleSets). Sending email on Port 25 is unsupported from all Azure Platform-as-a-Service (PaaS) resources, including Azure App Service and Azure Functions.  

 

Vultr:

Vultr port 25 is blocked by default along with some more ports listed below this we see that users should have right to choose themselves when they are handling the security of their Instances or Virtual Machines.

Source:

https://www.vultr.com/docs/what-ports-are-blocked/

What Ports Are Blocked? We block several outbound ports for network security. Blocked by default You may request these blocks be removed by opening a support ticket. TCP port 25 (SMTP) TCP & UDP port 137 TCP & UDP port 138 TCP & UDP port 139 TCP & UDP port 445 TCP port 1688 (KMS, inbound only)

 

Oracle Cloud Infrastructure: