Skip to main content

Common problems

Port 25, 465, or 587: which one is actually broken?

Receiving mail and sending mail use different ports, different encryption, and fail independently. A closed submission port does not stop inbound delivery.

On this page

Something is wrong with mail and a port is closed. Before changing anything, work out which direction of mail flow that port is even involved in, because the answer is often neither.

Receiving mail and sending mail are separate services on separate ports. They fail independently, and a closed port on one side tells you nothing about the other.

The three ports

PortDirectionEncryptionWho connects
25Inbound deliverySTARTTLS, opportunisticOther mail servers, sending you mail
465Outbound submissionImplicit TLS, encrypted from the first byteYour users and applications
587Outbound submissionSTARTTLSYour users and applications

So:

  • Port 587 or 465 closed: your clients cannot send through this server. Inbound mail is unaffected.
  • Port 25 closed or refusing: you are not receiving mail. This is the one that loses you messages.
  • Port 25 open with no STARTTLS: you receive mail, but some of it arrives unencrypted across the internet.

Many hosting providers block outbound port 25 from their networks by default to limit spam, which is a frequent and entirely separate source of confusion when an application cannot send mail.

Check what is actually listening

# Inbound delivery, and whether it offers STARTTLS
openssl s_client -starttls smtp -connect mx.example.com:25 -crlf </dev/null 2>&1 | head -20

# Submission, implicit TLS
openssl s_client -connect mail.example.com:465 -crlf </dev/null 2>&1 | head -20

# Submission, STARTTLS
openssl s_client -starttls smtp -connect mail.example.com:587 -crlf </dev/null 2>&1 | head -20

Find your receiving hosts first, and check every one of them rather than only the first:

dig +short MX example.com

Check every MX, not just the primary

Backup MX hosts are where TLS quietly rots. They are configured once, rarely tested, and then a sending server fails over to one during an incident and delivers your mail over an unencrypted connection, or to a host presenting an expired certificate.

If a domain has four MX records, all four are real delivery destinations as far as the sending world is concerned. Test them as such.

STARTTLS is opportunistic, which is the catch

On port 25, STARTTLS is an offer rather than a requirement. A sending server asks whether encryption is available and proceeds either way. If your server does not advertise it, mail still arrives, just in plain text.

That is why “mail is working” and “mail is encrypted in transit” are separate questions, and why the fix for a missing STARTTLS is never visible to your users. Enforcing encryption for inbound mail is what MTA-STS and DANE are for. Both are covered in SPF, DMARC, MTA-STS, TLS-RPT, and DANE.

For the full set of mail transport observations and what each listener state means, see mail routing and TLS transport.

Questions people ask

What is the difference between port 465 and port 587?

Both are for submission, meaning your own users and applications sending mail out. Port 465 uses implicit TLS, encrypted from the first byte. Port 587 starts in the clear and upgrades with STARTTLS. Neither has anything to do with receiving mail.

My port 587 is closed. Can I still receive email?

Yes. Inbound mail from the rest of the internet arrives on port 25. Submission ports being closed affects your ability to send through that server, not your ability to receive.

Should I still use STARTTLS or move to implicit TLS?

For submission, 465 with implicit TLS is the cleaner choice because there is no unencrypted phase to downgrade. Port 587 with STARTTLS remains widely used and fine when the client requires TLS. For inbound delivery on port 25 you do not get to choose, since STARTTLS is what sending servers expect.

Last verified Sep 18, 2026

Try these checks on your own domain: Start a free scan. If a result needs a closer look, contact us.