Port 25 blocked: why cloud hosts and ISPs block SMTP, and what to do
Most cloud hosts and home ISPs block outbound port 25 to stop spam from infected or abused machines. At the time of writing (November 2026), AWS, Google Cloud, DigitalOcean, Vultr, Hetzner and most Azure subscriptions block it by default. Some lift it on request, but the reliable fix is to send through an authenticated relay on port 587 or 465.
On this page 7 sections
You set up a new server, point an app at a mail server, and nothing sends. The connection to port 25 just hangs, then times out. Before you change any mail settings, check whether your network allows port 25 at all. On most cloud platforms and home connections, it doesn't, and that is deliberate.
Why is port 25 blocked?
Port 25 is blocked on most cloud servers and home connections because it's the port spam uses to go directly from an infected or abused machine to recipients' mail servers. Port 25 is the standard port for server-to-server mail delivery: every receiving mail server listens on it, and anyone who can open a connection to it can try to hand over a message. Malware on home computers and rented servers used by spammers do exactly that, bypassing any provider that would notice.
Blocking outbound port 25 from networks that shouldn't run mail servers closes that path. The anti-abuse industry group M3AAWG says in its port 25 best practices refresh: "Blocking port 25 for all but a few restricted purposes is still considered an industry best practice." It also tells providers to "provide email submission services on ports 465 and 587" so their customers can still send.
This is why the block rarely affects ordinary users. A mail app or website plugin should send through its provider on port 587 or 465 with a login, not straight to the recipient on port 25. Our guide to SMTP ports 25, 587, 465 and 2525 explains what each port is for. The block hurts in three situations:
- You run your own mail server (Postfix, Exim, Exchange) on a cloud VM or a home line.
- A device or app is configured to deliver directly to recipients instead of using a relay.
- You're testing a remote server's MX host from a laptop or a new cloud server.
How do you check whether port 25 is blocked?
Test a connection to a well-known MX host on port 25, then the same kind of test on a submission port. If 25 times out and 587 connects, port 25 is being blocked between you and the internet.
- Find an MX host to test against. Use the MX Lookup or
nslookup -type=mx gmail.com. Gmail's MX hosts listen on port 25 for every sender on the internet. - Test port 25. On Windows, run
Test-NetConnection gmail-smtp-in.l.google.com -Port 25in PowerShell and read theTcpTestSucceededline. On macOS or Linux, runnc -vz -w 10 gmail-smtp-in.l.google.com 25. - Test port 587 for comparison. Run the same command against
smtp.gmail.comon port 587. - Read the result.
| Port 25 result | Port 587 result | What it usually means |
|---|---|---|
Connects, 220 greeting |
Connects | No block; look for a configuration or authentication problem |
| Times out | Connects | Port 25 is blocked by your ISP, cloud host or firewall |
| Times out | Times out | General outbound filtering, a local firewall or no internet route |
| Connection refused | Connects | Something actively rejecting 25, often a local firewall or security software |
Connects, then 554 or 421 |
n/a | No block; the receiver is refusing your IP (reputation or reverse DNS) |
Run the test from the machine that sends the mail, not from your laptop, because each network has its own rules. Our guide to testing an SMTP server with Telnet and OpenSSL covers the full conversation once the port connects.
A connection that opens and then gets refused is a different problem. That's the receiver judging your IP, usually because it lacks proper reverse DNS or is on a blocklist. Check both with the Reverse DNS (PTR) Lookup and the Blacklist Checker.
Which cloud providers block port 25?
Most major cloud and VPS providers block outbound port 25 by default, and their policies differ on exceptions. The table below summarizes each provider's own documentation at the time of writing (November 2026). Policies change, so confirm on the linked page before you plan around them.
| Provider | Default for outbound port 25 | Can it be lifted? | Ports 587 and 465 |
|---|---|---|---|
| Amazon EC2 and Lambda | Blocked to public IPv4 and IPv6 addresses | Yes, by request form, per Region | Not restricted by this rule |
| Microsoft Azure VMs | Blocked, except on Enterprise Agreement and MCA-E subscriptions | Enterprise Dev/Test can be exempted through a diagnostic; other types aren't | Authenticated relay on 587 "isn't restricted" |
| Google Cloud Compute Engine | Blocked to destinations outside your VPC | Some projects are exempt | Not restricted |
| DigitalOcean Droplets | 25, 465 and 587 all blocked | No process described | Blocked too |
| Akamai (Linode) | 25, 465 and 587 restricted on some accounts created after November 5, 2019 | Yes, by support request | Restricted with 25 |
| Vultr | Blocked on new instances | Case by case, by support ticket | Not covered by this block |
| Hetzner Cloud | 25 and 465 blocked | After one month and a paid invoice, by limit request | 587 not blocked |
The details, in each provider's words:
Amazon Web Services
AWS's EC2 quotas page says that by default, "traffic over port 25 is blocked to public IPv4 addresses and IPv6 addresses", and that "you can request that this restriction be removed." The re:Post article gives the steps: open the Request to remove email sending limitations form, explain your use case and "how you plan to stop unwanted outbound email from your account", and name the Region. "If you have instances in more than one AWS Region, then you must submit a separate request for each Region." The same form can set a reverse DNS record on an Elastic IP, as long as an A record for that name points to the same IP. AWS says the request "might take up to 48 hours to process" and recommends Amazon SES as the alternative.
Microsoft Azure
For subscription types other than Enterprise Agreement and MCA-E, Microsoft Learn says: "The Azure platform blocks outbound SMTP connections on TCP port 25 for deployed VMs." Standard Enterprise Agreement and MCA-E subscriptions aren't blocked, though "there's no guarantee that external domains accept the incoming emails". Enterprise Dev/Test subscriptions are blocked by default; you can request removal by running the Cannot send email (SMTP-Port 25) diagnostic under Diagnose and Solve in the Azure Virtual Network resource. After an exemption, VMs "must be stopped, deallocated, and then restarted". For everyone else, Microsoft recommends an authenticated SMTP relay, noting that port 587 "isn't restricted in Azure, regardless of the subscription type."
Google Cloud
Google Cloud's documentation says "connections to destination TCP Port 25 are blocked when the destination is external to your VPC network", though "some projects do not have this restriction". It "does not place any restrictions" on destination ports 587 or 465.
DigitalOcean, Akamai, Vultr and Hetzner
- DigitalOcean: "SMTP ports 25, 465, and 587 are blocked on Droplets to prevent spam and other abuses on our platform." It recommends a third-party email service and says "we strongly recommend against running your own mail server."
- Akamai (Linode): "restrictions have been placed on outbound connections over ports 25, 465, and 587 on Linodes for some new accounts created after November 5th, 2019". Support reviews requests that include your name, your use case and sending practices, and every domain you'll send from.
- Vultr: "By default, outbound traffic on port 25 is blocked on all new Vultr Compute Instances." A support ticket should give your use case, spam protections such as SPF, DKIM or rate limits, and expected volume; "approval is reviewed case-by-case and not guaranteed."
- Hetzner: "we block ports 25 and 465 by default on all cloud servers." "Once you have been with us for a month and paid your first invoice, you can create a limit request to unblock these ports for a valid use case." "Port 587 is not blocked and can be used without sending a limit request."
Do home and business ISPs block port 25?
Many residential ISPs block port 25, and some block it in both directions. Comcast's Xfinity, for example, says it "does not support port 25 for the transmission of email by our residential Internet customers", citing the "long standing recommendation from M3AAWG" and the IETF "that port 25 be blocked". Its blocked ports list shows port 25 blocked in both directions and recommends port 587 for its own email service.
A two-way block means you can't run a reachable mail server on that line at all: other servers can't deliver to you, and your server can't deliver out. Business plans with static IP addresses often have different rules, so ask your ISP. Even where port 25 is open, mail from residential IP ranges is widely distrusted by receivers, so a home connection makes a poor mail server.
What should you do instead of using port 25?
Send through an authenticated relay on port 587 or 465, and let the relay deliver on port 25 from IP addresses it manages. A relay used this way is called a smart host. This is what every major cloud provider recommends, and it usually delivers better than a fresh cloud IP would anyway. Our guide to what a smart host is covers the concept and the SPF and DKIM changes.
Pick the option that matches your setup:
- An app or website on a cloud server: use your mail provider's submission service, such as Microsoft 365 or Gmail on port 587, or your cloud's own email service (Amazon SES on AWS, Azure Communication Services on Azure). For WordPress, see WordPress SMTP setup with SPF and DKIM.
- A Postfix server: set
relayhostto the relay's host and port, for examplerelayhost = [smtp.example.net]:587, and turn onsmtp_sasl_auth_enableand TLS. Postfix documentsrelayhostas "the next-hop destination(s) for non-local mail", and square brackets turn off MX lookups for that host. - Printers and scanners: see scan to email with Microsoft 365 or the Google Workspace SMTP relay service.
- A provider that blocks 587 and 465 too, such as DigitalOcean: use your sending service's HTTPS API, or a submission port your relay documents that your host doesn't block.
Whichever relay you choose, add it to your SPF record and turn on DKIM signing for your domain, or your mail will fail authentication. Also check the relay's limits: Microsoft 365 and Google Workspace cap how much a mailbox can send, as covered in email sending limits.
If your provider lifts the block, what do you need?
Getting port 25 opened is the start, not the finish. Receivers judge every new sending IP, and a cloud IP with no history starts at a disadvantage. Before you send real mail directly:
- Set a PTR record on the sending IP that names your server, with a matching A record.
- Use the same name as your HELO/EHLO hostname. See the HELO/EHLO hostname explained.
- Publish SPF, DKIM and DMARC for every domain the server sends from.
- Check the IP against blocklists, because cloud addresses are reused and may carry an old listing.
- Start with low volume and watch bounces and spam-folder placement.
- Send a test to the deliverability test, which reports reverse DNS, blocklists, TLS and authentication for the message it receives.
Next steps
- Run the port test from the machine that sends mail, and keep the result for your provider's support team.
- If you don't need your own mail server, move the app or device to authenticated submission on 587 or 465 and stop fighting the block.
- If you do need direct delivery, request the exemption from your cloud provider and complete the checklist above first.
- For low-volume sending from servers, devices and contact forms, iBlockSpam's outbound relay is a smart host with DKIM signing and outbound filtering, with 500 messages per domain per month included.
Frequently asked questions
How do I know if my ISP blocks port 25?
Try to open a TCP connection to a public mail server on port 25, for example with Test-NetConnection on Windows or nc -vz on macOS and Linux. If it times out but the same test on port 587 to a submission server succeeds, something on your network path is blocking port 25. Your ISP's support pages or a support ticket will confirm it.
Can AWS remove the port 25 restriction?
Yes, on request. AWS's re:Post article says to submit the Request to remove email sending limitations form, describe your use case and how you'll prevent unwanted mail, and submit one request per Region. You can also ask AWS to set reverse DNS for an Elastic IP. AWS says processing can take up to 48 hours.
Does DigitalOcean unblock SMTP ports on request?
DigitalOcean's support page says SMTP ports 25, 465 and 587 are blocked on Droplets, and describes no request process. It recommends a third-party email service and strongly recommends against running your own mail server. Plan to send through an HTTPS email API or a relay that accepts a non-blocked port your provider documents.
Does a port 25 block stop me from receiving email?
An outbound block doesn't, because other servers connect to you. Inbound port 25 can still be blocked, though: Xfinity lists port 25 as blocked in both directions on its network, so you can't run a reachable mail server on a residential line there. Cloud servers usually accept inbound 25 if your firewall allows it.
Is port 2525 a way around a port 25 block?
Only if your sending service documents it. Port 2525 isn't an email standard; some relay services accept submission on it as a fallback. It still needs TLS and authentication, and it only works for handing mail to that service, not for delivering directly to recipients' MX hosts, which always listen on port 25.
Sources
- M3AAWG: Best Common Practices for Managing Port 25 (refresh)
- Microsoft Learn: Troubleshoot outbound SMTP connectivity in Azure
- Google Cloud: Sending email from an instance
- AWS: Amazon EC2 service quotas, restriction on email sent using port 25
- AWS re:Post: How do I remove the restriction on port 25 from my Amazon EC2 instance or Lambda function?
- DigitalOcean: Why is SMTP blocked?
- Hetzner Docs: Cloud servers FAQ
- Xfinity: Why is port 25 for email submission not supported?
See how your domain measures up
Run a free Email Health Check: MX, SPF, DKIM, DMARC and transport security in one scan, with the raw records shown. No sign-up.
Keep reading
What is a mail server, and how does it work?
What a mail server is, the difference between incoming and outgoing servers, how one handles a message, how to find yours, and what running your own involves.
10 min read Email security basicsSMTP ports 25, 587, 465 and 2525: which one should you use?
Which SMTP port to use: 25 for server-to-server relay, 587 with STARTTLS or 465 with implicit TLS for sending from apps, and why port 25 is often blocked.
10 min read Email security basicsWhat is a smart host, and when do you need an SMTP relay?
What a smart host (SMTP relay) is, how it differs from an open relay, when apps, printers and servers need one, how to authenticate, and the SPF and DKIM impact.
9 min read