skip to content

For POP3 access to a mail service offering port 110 with STLS and port 995, which should clients use, and why does RFC 8314 prefer it?

level: seniorimportance: should knowfreq 30%

answer

  1. TLS before the first command
  2. the cleartext prelude
  3. STLS can be missing from CAPA
  4. RFC 2595 section 7 replaced
  5. APOP hid only the password

basics

~20 s

Use port 995: POP3S starts TLS before any POP3 command, so nothing travels in cleartext. RFC 8314 (2018) prefers it to STLS on 110, whose cleartext start a client may fail to upgrade, and treats cleartext login as obsolete.

solid answer

~40 s

Configure clients for `995`. There, TLS begins the moment TCP connects, so the greeting, the capability list and the login are all protected. On `110` the session starts in cleartext and the client must see `STLS` in the `CAPA` list (RFC 2595) and ask for the upgrade; that cleartext prelude is unauthenticated, so a client set to "use TLS if available" can end up logging in without it. RFC 8314 (January 2018) reverses RFC 2595's old advice against separate secure ports: it recommends implicit TLS, still asks providers to offer `STLS` in the near term for existing clients, asks them to deprecate cleartext, and requires clients to validate the server certificate (RFC 7817). Cleartext `USER`/`PASS` on 110 exposes the password; `APOP`'s MD5 challenge hid only the password, never the mail.

code

plaintext · 17 lines
plaintext
S: +OK POP3 server ready
C: CAPA
S: +OK Capability list follows
S: TOP
S: UIDL
S: STLS
S: .
C: STLS
S: +OK Begin TLS negotiation
   <TLS handshake; everything below is encrypted>
C: CAPA
S: +OK Capability list follows
S: TOP
S: UIDL
S: USER
S: SASL PLAIN
S: .

go deeper

for a junior

Recall that POP3 over implicit TLS uses port 995 and that 110 starts in cleartext. A password typed over plain 110 crosses the network readable.

for a middle

Explain STLS: offered in CAPA, allowed only in AUTHORIZATION, followed by a fresh CAPA. Contrast it with TLS starting at connect on 995.

for a senior

Argue why the unauthenticated prelude makes 995 the safer default, why APOP is history, and what RFC 8314 asks servers and clients to enforce, including certificate validation.

for a principal

Own the retirement plan for cleartext: when 110 closes, how refusals avoid leaking credential validity, and which passwords must be rotated.

## Three ways onto a POP3 server | Connection | How TLS starts | What travels in cleartext | |---|---|---| | Port `110`, no TLS | Never | Everything: greeting, password, every message | | Port `110` with `STLS` | Client sends `STLS` after reading `CAPA` | Greeting, `CAPA` list, the `STLS` command and reply | | Port `995` ("pop3s") | TLS handshake as soon as TCP connects | Nothing at the POP3 layer | `STLS` comes from RFC 2595 (June 1999). It is permitted only in the AUTHORIZATION state, a server offering it must also implement `CAPA` (RFC 2449), and after TLS starts the client MUST discard the capabilities it saw before and SHOULD issue `CAPA` again, because the server may advertise different capabilities once the channel is protected. Port `995` is the implicit-TLS service RFC 8314 standardised for POP3: after the handshake the server greets and the session enters AUTHORIZATION as usual. ## Why cleartext USER/PASS and APOP gave way - **`USER`/`PASS`** sends the mailbox password as typed. RFC 1939 itself pointed out that clients polling every few minutes multiply the chances of that password being captured. - **`APOP`** was RFC 1939's answer: the server puts a unique timestamp in its greeting, and the client sends an MD5 digest of that timestamp followed by a shared secret. It kept the password off the wire and resisted replay. But it protected nothing else — every message still crossed the network in cleartext — and the server had to hold the shared secret itself. - RFC 6151 (March 2011), on MD5's security, notes that published collision research from 2007 applies to challenge-and-response schemes such as APOP. Why MD5 no longer protects a secret is covered with hashing; for this choice it is enough that APOP is history, not a protection. - The replacement is **TLS for the whole session**, with authentication inside it: `USER`/`PASS` or a SASL mechanism via `AUTH` (RFC 5034, July 2007, obsoleting RFC 1734). ## STLS and its weak point The upgrade model has one structural gap: everything before the TLS handshake is unauthenticated. RFC 2595's own security considerations say an on-path party can remove `STLS` from the capability list or make the command fail, and that a client should warn the user or be configurable to refuse to continue without encryption. A client set to "use TLS when available" therefore protects only against passive observers. Implicit TLS has no cleartext phase to tamper with, so the decision "is this session encrypted?" is made by the port, not by a message an attacker could influence. ## Why RFC 8314 reversed the old advice RFC 2595 section 7 had discouraged the separate `pop3s` and `imaps` ports in favour of `STLS` and `STARTTLS`. RFC 8314 (January 2018, "Cleartext Considered Obsolete") replaced that section: 1. Implicit TLS "has been deployed more successfully", so it is now recommended for POP, IMAP and submission. 2. Providers SHOULD offer implicit-TLS services, SHOULD also offer `STLS`-style services in the near term for existing clients, and SHOULD deprecate cleartext as soon as practicable. 3. Clients MUST validate the server certificate under RFC 7817, and MUST NOT count a session as confidential if it cannot be validated. It deprecates cleartext; it does not delete port `110` from POP3. Minimum TLS versions were later raised to TLS 1.2 by RFC 8997 (March 2021); version detail belongs with TLS itself. ## What to configure and how to tell - Point every client at `995`, with certificate validation on and "require encryption" rather than "if available". - If `110` must stay for legacy clients, offer `STLS` and make the server refuse cleartext login commands until TLS is active, as RFC 2595 requires servers to be configurable to do. A pre-TLS `CAPA` that lists `USER` or `SASL PLAIN` shows cleartext login is still on offer. - When cleartext login is switched off, RFC 8314 says the refusal over cleartext MUST NOT reveal whether the credentials were valid, and passwords that were sent in cleartext SHOULD be changed if they were likely compromised. - Publish `_pop3s._tcp` SRV records (RFC 6186) and advertise implicit TLS in preference, as RFC 8314 asks. - Check the server's logs for logins on `110` without TLS: they are the users still exposed.

  • Why must a POP3 client discard the capability list it received before STLS?
    Because everything before the TLS handshake travelled in cleartext and could have been altered. RFC 2595 says the client MUST discard cached capabilities once TLS starts and SHOULD re-issue `CAPA`; the server may legitimately advertise more after the upgrade, such as `USER` or `SASL PLAIN` that it hides on an unprotected channel.
  • Is it a protocol violation for a mail service to keep offering POP3 on port 110?
    No. RFC 8314 deprecates cleartext access and asks providers to retire it as soon as practicable, while allowing `STLS` on 110 in the near term for existing clients. It does not remove port 110 from POP3. A server that keeps 110 should refuse login until TLS is active, so the port is only a way to reach `STLS`.

  • STLS on port 110 always ends up encrypted, so it is exactly equivalent to port 995.
  • APOP makes POP3 on port 110 safe because the password is never sent.
  • RFC 8314 forbids POP3 servers from listening on port 110.
  • Port 995 needs no certificate checking because the connection is already encrypted.
  • A client set to use TLS when available will always end up encrypted.