Mail Port and SSL Checklist: Implicit TLS vs STARTTLS

Every few months someone posts a screenshot of a mail client throwing «certificate verify failed» or «SSL routines: wrong version number» and asks which SSL certificate to buy. Nine times out of ten, the certificate is fine. The problem is that the client is speaking STARTTLS to a port that expects implicit TLS, or the other way round. The handshake fails before any certificate gets evaluated, so the error message points at the wrong culprit. Get the port and the TLS mode right and the certificate question usually disappears.

Why port 993 and port 110 behave nothing alike

Here is the myth that refuses to die: «SSL on» is a single checkbox. It is not. There are two distinct ways a mail protocol wraps a connection in TLS, and they are not interchangeable. Implicit TLS means the client opens a TCP connection and TLS negotiation starts immediately, before a single byte of mail protocol is exchanged. STARTTLS means the client first speaks plaintext, asks the server «can we upgrade?», and only then begins TLS on the same connection. Same encryption, completely different choreography. Send the wrong opening move and the server rejects you at the transport layer.

IMAP uses encrypted port 993 for implicit TLS and port 143 for STARTTLS. POP3 uses encrypted port 995 for implicit TLS and port 110 for STARTTLS. Those four numbers are the whole game. IMAP 993 and POP3 995 are the canonical secure ports, and they are implicit TLS by definition. Ports 143 and 110 are the STARTTLS ports, and they are plaintext-first by definition. A client configured for STARTTLS pointed at port 993 will send an IMAP or POP3 command into a socket that is waiting for a TLS ClientHello. The server either drops the connection or answers with a TLS alert. The client reports a handshake or certificate error. Nothing is wrong with the certificate.

The reverse mistake happens too, and it is sneakier. A client set to implicit TLS on port 143 opens with a ClientHello, and the server, expecting a plaintext greeting, either hangs or returns a protocol banner that the TLS stack cannot parse. You get a timeout or a garbled error that looks like a firewall problem. The fix in both directions is the same: match the TLS mode to the port, not the other way around. If your provider publishes «993 (SSL/TLS)» and «143 (STARTTLS)», that is not redundant marketing text. It is the configuration contract.

Reading the provider’s port table correctly

Most hosting documentation lists incoming mail server settings as hostname plus port plus a security label. Treat that label as authoritative. «SSL» or «SSL/TLS» next to 993 or 995 means implicit TLS. «STARTTLS» or «TLS» next to 143 or 110 means plaintext connect followed by an upgrade. If a provider lists both port 993 and port 143 with the word «SSL», one of those rows is wrong, and you should test both rather than trust the table. The same logic applies to the outgoing mail server: SMTP handles sending mail, and its submission ports follow the same split. Port 465 is implicit TLS, port 587 is STARTTLS, and port 25 is for server-to-server relay and should not be your client’s submission path.

One wrinkle worth knowing: modern clients often auto-detect settings through DNS SRV records or autoconfig, and they usually get it right. When they get it wrong, they get it wrong confidently, silently picking STARTTLS on 993 and then failing at login. If autoconfig produced the error, do not trust autoconfig to fix it. Enter the host, port, and security mode by hand and confirm the connection succeeds before you blame anything else.

The per-port checklist to run before touching certificates

Run this in order. Each step isolates one variable, so when something fails you know exactly which layer broke. It takes about five minutes and saves an afternoon of certificate shopping you did not need. The core rule: verify implicit TLS versus STARTTLS per port, not just «SSL on». A checkbox that says SSL tells you nothing about which of the two handshake styles the client will attempt.

From openssl to the client’s connection log

Start at the command line, where the error messages are honest. For IMAP implicit TLS, run openssl s_client -connect mail.example.com:993 -servername mail.example.com and look for «Verify return code: 0 (ok)» plus a certificate chain. That single command confirms the port speaks TLS immediately and the certificate validates for the hostname you typed. For POP3 implicit TLS, the same command against port 995. When weighing POP3 vs IMAP for automation tools, these checks help you isolate the cause. If those succeed, your certificate and DNS are fine and any remaining failure lives in the client configuration.

For the STARTTLS ports, the command changes shape: openssl s_client -connect mail.example.com:143 -starttls imap and openssl s_client -connect mail.example.com:110 -starttls pop3. The -starttls flag tells openssl to speak plaintext first and issue the upgrade command, which is exactly what a correctly configured client does on those ports. If you omit the flag and the connection fails, that is expected. If you include it and the connection fails, the server is not offering STARTTLS on that port, and you should move to the implicit TLS port instead.

Then move to the client. Check four fields: incoming hostname, incoming port, security mode, and username format. The security mode must read «SSL/TLS» or «implicit» for 993 and 995, and «STARTTLS» for 143 and 110. Some clients label implicit TLS as «SSL» and STARTTLS as «TLS», which is confusing but consistent across most vendors. After a successful connection, check the log or the connection info panel and confirm the negotiated TLS version and cipher. If it says TLS 1.2 or 1.3 with a modern cipher, you are done. If it says SSLv3 or nothing at all, the client silently fell back to plaintext and you have a different problem.

Finally, repeat the check on every device. IMAP synchronizes folders and read states across devices, so a single misconfigured client can look like server-side weirdness on the others. POP3 downloads mail to a single client, which means a broken POP3 setup on one machine may go unnoticed until someone else opens the mailbox and finds messages missing. Test each client independently against the same host and port pair.

Where this bites hardest: automation, catch-alls, and legacy defaults

SEO automation tools default to POP3 more often than people expect, and that default carries a port assumption with it. The tool opens port 110 with STARTTLS, or port 995 with implicit TLS, and if you paste in a hostname configured for the other mode, the job fails with a TLS error that reads like a certificate problem. POP3 supports inbox only, no folders, no read-state sync. That is fine for a tool that just wants to pull verification emails and confirmation links. It is not fine if you also want the same mailbox synced to your phone, because POP3 will not do that.

This is where catch-all email domains earn their keep. AllMail provides catch-all domains for projects, so each automation job can have its own address on a domain that accepts everything. You can point one job at POP3 on port 995 and leave the rest of the mailbox untouched. The port checklist still applies per job: confirm the tool’s security dropdown matches the port you entered, and test the connection once before scheduling anything. A failed automation run at 3 a.m. because someone typed 110 with «SSL» selected is an avoidable waste of a morning.

Protocol versions matter at the edges. IMAP4rev2 is defined by RFC 9051, which supersedes the older IMAP4rev1 spec, and most servers negotiate capabilities during the connection. POP3 is defined by RFC 1939, a much smaller and older protocol with fewer moving parts. Neither spec changes the port and TLS rules above, but a client that claims IMAP4rev2 support and still fails on 993 is almost certainly misconfigured at the TLS layer rather than missing a capability. Check the port mode first, then the protocol version.

One more trap for the paranoid: certificate hostname mismatches are real, but they produce a specific error naming the hostname and the certificate’s subject. A generic handshake failure, a «wrong version number» message, or a connection reset with no certificate detail is a port and TLS mode problem, not a certificate problem. Learn to tell those two error families apart and you will stop buying certificates you do not need.

Work through the checklist once per client and per automation job: confirm the port, confirm the TLS mode matches that port, run the openssl test with the right flag, then check the client log for a negotiated TLS version. Keep the four canonical numbers handy, 993 and 995 for implicit TLS, 143 and 110 for STARTTLS, and treat every «SSL on» checkbox as a question rather than an answer. The certificate was probably fine all along.

Etiquetas: Sin etiquetas

Los comentarios están cerrados.