📬
blog.cat.ssl

Mail Ports and SSL: When to Use 465, 587, 993 and 995

24.11.2026
← All articles

When setting up a mail client, the fields that cause the most confusion are the port number and the encryption type. 465 or 587, SSL/TLS or STARTTLS, 993 or 143: without understanding the difference, finding the right combination is guesswork, and the wrong choice means messages do not send or the client waits and then fails. This article explains what each port is for, how encryption is switched on and how to test connections from the command line.

Two ways to encrypt: implicit TLS and STARTTLS

With implicit TLS the connection is encrypted from the first byte; mail clients usually call this "SSL/TLS". With STARTTLS the session starts in plain text and the client then issues a command to upgrade it. Both protect traffic when configured properly, but STARTTLS has a brief unencrypted phase, and a loosely configured client can be tricked into continuing without encryption if an attacker strips the command. That is why current guidance, including RFC 8314, prefers implicit TLS for clients. If you use STARTTLS, choose the mandatory mode rather than "if available".

PortProtocolEncryptionPurpose
25SMTPSTARTTLS (optional)Server-to-server delivery
465SMTPImplicit TLSClient submission
587SMTPSTARTTLSClient submission
143IMAPSTARTTLSReading mail
993IMAPImplicit TLSReading mail
110POP3STARTTLS (STLS)Downloading mail
995POP3Implicit TLSDownloading mail

The rule of thumb: 465, 993 and 995 use "SSL/TLS", while 587, 143 and 110 use "STARTTLS". Mixing these pairs is the most common mistake.

Sending: 465 versus 587

Both ports are for client submission with username and password authentication. 587 has long been the standard submission port with STARTTLS. 465 has a messy history: it was once declared obsolete and later re-recognized as the implicit TLS submission port. Today both are legitimate and most servers support them side by side. Port 25 is not for clients at all; it is how servers deliver to each other, and many ISPs and cloud platforms block outbound port 25 from ordinary users to fight spam. If your client sends on 25 and mail is stuck, switch to 465 or 587.

Reading: IMAP or POP3

IMAP keeps mail on the server and syncs every device, so a message read on a phone shows as read on the laptop. POP3 downloads mail to one device and may delete it from the server depending on settings. For anyone using several devices, IMAP on port 993 is the sensible default.

Testing from the command line

When a client only says "cannot connect", openssl s_client tells you whether the port is closed or the encryption type is wrong.

# Implicit TLS: 465, 993, 995
openssl s_client -connect mail.example.uz:465 -servername mail.example.uz -crlf
openssl s_client -connect mail.example.uz:993 -servername mail.example.uz

# STARTTLS: 587, 143, 110
openssl s_client -starttls smtp -connect mail.example.uz:587 -servername mail.example.uz -crlf
openssl s_client -starttls imap -connect mail.example.uz:143 -servername mail.example.uz
openssl s_client -starttls pop3 -connect mail.example.uz:110 -servername mail.example.uz

Success shows the certificate chain, Verify return code: 0 (ok) and a server greeting. A long hang suggests the port is blocked. On Windows, PowerShell checks reachability quickly:

Test-NetConnection mail.example.uz -Port 587

TcpTestSucceeded : True means the port is open; False points to the network, such as an office firewall, hotel Wi-Fi or ISP restriction.

Example: mail stuck at a Tashkent office

At a construction company in Tashkent, a new accountant's laptop received mail but could not send. Outlook had port 465 with STARTTLS selected: the client waited for a plain-text dialogue while the server expected a TLS handshake immediately, so the connection timed out. Switching encryption to SSL/TLS fixed it; keeping STARTTLS and moving to 587 would have worked too. Later a manager on a business trip could not send from hotel Wi-Fi despite correct settings. Test-NetConnection showed 587 closed and 465 open, so switching to 465 with SSL/TLS solved it.

Certificates and the server name

Even with the right port, the certificate must match the server name you typed, or the client will warn you. sayt.uz customers can confirm the mail server name and recommended ports in the cabinet or through support.

Related articles

🔒 How to Fix Mixed Content in WordPress: A Step-by-Step Guide 🔍 Free Tools to Check Your SSL Certificate: From Browser to Terminal 💻 SSL for local development: trusted HTTPS with mkcert 🔄 The End of OCSP and the Return to CRLs: What Site Owners Should Know
🌐 Language
🇺🇿 O⁠'zbek 🇺🇿 Özbek (yangi) 🇺🇿 Ўзбек 🇷🇺 Русский 🇬🇧 English ✓