Port 25 is the original SMTP port, used by mail servers to relay email to each other. It dates to RFC 821 in 1982 and is still the standard port for server-to-server mail delivery. It is not for sending mail from an email app: modern clients use port 587 or 465 with authentication, and most ISPs and cloud providers block outbound port 25 to stop spam.
Key takeaways
- Port 25 carries SMTP relay traffic between mail servers — it is not the port your email app should use to send mail.
- Most ISPs and cloud providers block outbound port 25 because open relays made it the spammer's favorite port.
- Send mail on port 587 with STARTTLS or port 465 with implicit TLS, and only open port 25 inbound if you run a mail server.
If you have ever set up an email server, or tried to send mail from a cloud server and watched the connection hang, you have probably met port 25. It is the oldest email port on the internet — and the one most networks now block on sight.
What is port 25?
Port 25 is the original port for SMTP, the Simple Mail Transfer Protocol that moves email across the internet. Mail servers use it to hand messages to each other, a process called relaying, and it has held that job since 1982.
Think of a port as a numbered door on a server. When one mail server wants to deliver a message to another, it knocks on port 25. The receiving server answers with a greeting, the two servers exchange a short conversation of SMTP commands, and the message changes hands. The SMTP specification, RFC 5321, defines this relay model, and it is still how email crosses the internet today.
Port 25 is assigned to SMTP in the IANA service name and port number registry. It sits in the well-known port range below 1024, which is reserved for standard internet services. The original SMTP specification, RFC 821, was published in August 1982 — before the web existed, before spam was a business, and before anyone thought email would need passwords.
What does port 25 do?
Port 25 carries server-to-server email relay. When you send an email, your mail app hands it to your provider's server, and that server then uses port 25 to deliver it to the recipient's mail server.
A typical journey looks like this:
- You press send. Your email app submits the message to your provider's outgoing server on port 587 or 465, with your username and password.
- Your provider looks up the recipient's domain. It queries DNS for the MX records that say which servers accept mail for that domain. You can check any domain's MX records with our free MX lookup.
- Your provider connects to the recipient's server on port 25. It says hello (EHLO), states the sender and recipient addresses, and transfers the message.
- The recipient's server accepts or rejects the message. It may check SPF, DKIM and DMARC, run spam filters, and then store the message in the recipient's mailbox.
- The recipient reads it. Their app fetches the message over IMAP (port 993) or POP3 (port 995) — never over port 25.
Notice that port 25 appears exactly once in that chain, between two servers. Your phone, laptop and email app never need it.
Port 25 vs 587 vs 465: what's the difference?
Port 25 is for relay between servers, port 587 is for authenticated submission from clients, and port 465 is submission over implicit TLS. They all speak SMTP, but they serve different jobs and have different security rules.
| Port | Role | Authentication | Encryption | Who uses it |
|---|---|---|---|---|
| 25 | SMTP relay (server to server) | Usually none | None by default; STARTTLS optional | Mail servers only |
| 587 | Message submission | Required | STARTTLS (upgrades to TLS) | Email apps, scripts, services |
| 465 | Submission over implicit TLS | Required | TLS from the first byte | Email apps, if the provider lists it |
| 2525 | Unofficial submission fallback | Required | STARTTLS (varies) | Only when a provider specifies it |
Port 587 was created in 1998 by RFC 6409 (originally RFC 2476) precisely to split submission away from relay. The idea was simple: clients should authenticate before sending, and relay traffic should stay on its own port where different rules apply. As Spamhaus explains, port 587 is the default submission port on the modern web, and end users should be using 587 or 465 with SMTP authentication.
Port 465 has a messier history. It was first registered for SMTPS in the late 1990s, then reassigned and deprecated, then effectively revived because so many providers kept supporting it. RFC 8314 (2018) finally blessed it again as the implicit-TLS submission port. If your provider lists both, either works; 587 is the more common default.
Why is port 25 blocked?
Port 25 is blocked because spammers abused it for decades. In the 1990s, many mail servers were open relays: anyone could connect on port 25 and send mail through them, from anywhere, with no login at all.
Spammers discovered that an open relay was free postage. They could send millions of junk messages through other people's servers, and the complaints and blocklist entries landed on the server owner, not on them. Spamhaus puts it bluntly: port 25 is "the spammer's choice port of call", and it is only needed for use by mail servers.
The industry responded in layers:
- Open relays were closed. By 2005, the open-relay problem was largely solved as server software started requiring authentication for relaying.
- Port 587 split off submission. Legitimate users moved to an authenticated port, so blocking port 25 no longer broke normal email.
- ISPs blocked outbound port 25 for end users. Residential and mobile networks closed it for everyone except their own mail servers.
- Cloud providers followed. Google Cloud blocks outbound connections to port 25 for external destinations, due to the risk of abuse, while leaving ports 587 and 465 open. AWS and Azure apply similar restrictions.
The result is that port 25 is now a gated channel. It still works between legitimate mail servers, but a random laptop, phone or cloud VM cannot reach out on it. That is by design, not a bug in your configuration.
Is port 25 secure?
Port 25 is not secure by default. SMTP was designed in an era when the internet was a small research network, so the original protocol sends everything in plain text and asks no questions about who you are.
Three weaknesses matter most:
- No encryption by default. A plain port 25 connection sends the message, sender and recipient addresses in clear text. Servers can upgrade with STARTTLS, but that upgrade is opportunistic — if either side does not support it, the message still goes through in the clear.
- No authentication by default. A receiving server on port 25 generally accepts mail for its own domains from anyone. That is necessary — your server cannot demand a password from every server on the internet — but it is also why spam and spoofing exist.
- Spoofing is easy at the protocol level. Nothing in SMTP itself verifies that the sender address is real. That job falls to SPF, DKIM and DMARC, which receiving servers check after the message arrives. Our guide to what DMARC is explains how those checks work together.
Modern protections sit around port 25 rather than inside it: TLS encryption where both sides support it, authentication on the submission side, reputation blocklists such as Spamhaus, and content filtering. The port itself remains a plain, unauthenticated channel between servers that trust each other only cautiously.
When should you use port 25?
You should use port 25 only if you run a mail server that receives email directly from the internet. For almost everyone else, the correct answer is never.
Use port 25 when:
- You operate an inbound mail server (an MX host) and other servers on the internet need to deliver mail to it.
- You run a mail relay or gateway that forwards messages between servers inside your own infrastructure.
- You are testing mail delivery between servers with a tool like telnet, netcat or swaks.
Do not use port 25 when:
- You are configuring an email app such as Outlook, Thunderbird or Apple Mail — use 587 or 465.
- Your application or script sends email — use your provider's submission server on 587, or a transactional email API.
- You are running a website that sends password resets or receipts — use an email service over HTTPS or SMTP on 587.
- You are on a home, mobile or cloud network — outbound port 25 is almost certainly blocked there anyway.
How to fix port 25 connection problems
Most port 25 problems have the same cause: something upstream is blocking the port. Work through these checks in order before changing your mail server configuration.
Test whether the port is reachable
From the machine that cannot send mail, run telnet gmail-smtp-in.l.google.com 25 or nc -zv -w 5 gmail-smtp-in.l.google.com 25. A working connection answers with a 220 greeting within a few seconds. If it hangs and then times out, the port is blocked somewhere between you and the server. If it is refused immediately, the remote server is not listening on port 25.
Check your ISP or cloud provider
Residential ISPs, mobile networks and cloud platforms routinely block outbound port 25. Google Cloud documents the block openly, and AWS requires a request to remove its default throttle. Check your provider's documentation before assuming your server is at fault — and expect the answer to be that the block is intentional.
Switch to the submission port
If you are sending mail from an app or script, change the outgoing server settings to port 587 with STARTTLS (or 465 with SSL/TLS) and add authentication. This fixes the problem in nearly every case, because those ports are not blocked. If you run a website, consider a transactional email service instead of sending directly.
Check whether your IP is blocklisted
If you do run a mail server and other servers reject your mail, your IP address may be on a blocklist. Check it against Spamhaus and other DNS blocklists, and look at the bounce messages: a 550 rejection usually names the list. Fix the underlying cause — an open relay, a compromised account, a missing SPF record — before requesting removal.
Check your DNS records
Receiving servers increasingly reject mail from servers without proper reverse DNS, SPF and DKIM. Use our free DNS lookup to confirm your MX, SPF and DKIM records are published correctly.
While you are there, confirm your server's TLS certificate is valid with our SSL checker — a broken certificate is another common reason mail gets rejected.
Common mistakes with port 25
These errors show up again and again in support forums and server logs. Most of them come from treating port 25 as a general-purpose email port, which it has not been for over 25 years.
- Configuring an email client on port 25. It may work on a permissive network and then fail everywhere else. Use 587.
- Opening port 25 outbound on a firewall to fix sending. The block is usually upstream at the ISP or cloud provider, so a local firewall change does nothing.
- Running an open relay. A server that relays for anyone will be abused within hours and blocklisted, which then breaks your legitimate mail too.
- Assuming STARTTLS means the message is private end to end. STARTTLS only encrypts one hop. Each server in the chain decides separately whether to use it.
- Leaving port 25 open on a server that does not receive mail. An unused open port is an invitation for abuse and for scanners to probe your server.
- Using port 25 for application email. Password resets and notifications sent directly on port 25 are likely to be blocked or marked as spam. Use a proper submission path.
The bottom line
Port 25 is the original SMTP relay port, and it still does one job well: moving email between mail servers. Everything else about sending email has moved to authenticated, encrypted submission on ports 587 and 465.
If you run a mail server, keep port 25 open inbound, lock it down, and publish SPF, DKIM and DMARC. If you do not run a mail server, forget port 25 exists — your email app and your applications should use port 587. You can verify your own domain's mail setup in seconds with the free MX lookup.
Frequently asked questions
What is port 25 used for?
Port 25 is used for SMTP relay: one mail server handing a message to another mail server on its way to the recipient. It is the original SMTP port, defined in 1982, and it remains the standard port for server-to-server email delivery.
Should I use port 25 to send email from my app?
No. Port 25 is for mail servers, not email clients. Use port 587 with STARTTLS, or port 465 with implicit TLS, and authenticate with a username and password. Most networks block outbound port 25 anyway, so your connection will usually fail.
Why is port 25 blocked?
Port 25 was abused for decades by spammers using open relays to send junk mail from other people's servers. ISPs and cloud providers now block outbound port 25 for ordinary users and only allow it for mail servers, which cuts off a major spam channel.
Is port 25 secure?
Port 25 itself offers no encryption by default, although servers can upgrade a connection with STARTTLS. It also traditionally required no authentication, which is why it was abused. Modern submission ports 587 and 465 require authentication and encryption, which is why they replaced it for clients.
What is the difference between port 25 and port 587?
Port 25 is for relay between mail servers and usually needs no authentication. Port 587 is the message submission port for email clients and apps, and it requires authentication and normally uses STARTTLS encryption. Port 587 was created in 1998 specifically to separate submission from relay.
How do I know if port 25 is blocked on my network?
Try connecting with a tool like telnet or netcat, for example telnet gmail-smtp-in.l.google.com 25. If the connection times out instead of answering with a 220 greeting, the port is being blocked upstream. A refused connection usually means the server itself is not listening.
Do I need to open port 25 on my firewall?
Only if you run your own inbound mail server that must receive mail directly from other servers on the internet. If you use Gmail, Microsoft 365 or another hosted provider, you do not need port 25 open at all, and leaving it open only invites abuse.
What is port 2525?
Port 2525 is an unofficial alternative submission port offered by some email services when ports 587 and 465 are blocked. It is not assigned by IANA and not defined in any RFC, so only use it if your email provider specifically tells you to.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against RFC 5321 and RFC 6409, the Spamhaus port 25 FAQ and Google Cloud's email documentation.
How we write and fact-check →