skip to content

POP3

POP3 walks AUTHORIZATION, TRANSACTION and UPDATE, so DELE takes effect only after QUIT, and UIDL lets a client leave mail on the server. Interviewers ask when POP3 beats IMAP and what a drop undoes.

on this pageshow

explore

questions

5

Under POP3 (110/995), why does mail the office desktop has downloaded never show up on staff phones, and what does IMAP (143/993) do instead?

level: juniorimportance: must knowfreq 62%

answer

  1. download, then delete
  2. one device empties the server
  3. DELE committed at QUIT
  4. IMAP keeps the mailbox server-side
  5. 110/995 against 143/993

basics

~20 s

POP3 is download-and-delete: the desktop retrieves each message and deletes it from the server at QUIT, so the phone finds nothing. IMAP keeps mail on the server for every device. Ports: POP3 110/995, IMAP 143/993.

solid answer

~40 s

POP3 was designed for one client that drains a maildrop: it logs in, `RETR`s each message, marks it with `DELE`, and the server removes the marked messages when `QUIT` ends the session. A desktop with the usual download-and-delete setting therefore empties the server, and a phone that polls afterwards sees an empty maildrop. IMAP treats the server as the mailbox of record: messages and folders stay there, every device reads the same copy, and read or deleted state is shared. POP3 listens on `110` (cleartext, upgradable with `STLS`) and `995` (implicit TLS); IMAP on `143` (cleartext, upgradable with `STARTTLS`) and `993` (implicit TLS). For a mailbox read on more than one device, IMAP on `993` is the right default; RFC 8314 prefers the implicit-TLS ports for both.

go deeper

for a junior

Recall that a POP3 client usually downloads and then deletes, while IMAP keeps the mailbox on the server. Know the four ports: POP3 110 and 995, IMAP 143 and 993.

for a middle

Walk through the session that empties the box: RETR, DELE, then QUIT entering the UPDATE state. Explain why whichever device polls first takes the message.

for a senior

Diagnose the vanishing-mail ticket from the server log and the client settings, and say why leave-on-server only half fixes it. Prefer 995 and 993 under RFC 8314.

for a principal

Frame the choice as a policy: IMAP on 993 as the default for anyone on several devices, POP3 only where one consumer drains a mailbox, and cleartext ports retired on a schedule.

## What POP3 was built for The **Post Office Protocol version 3** (POP3, RFC 1939, May 1996) moves mail from a server's **maildrop** to one client. The model is a post-office box: the client collects what has arrived and takes it home. RFC 1939 states the philosophy plainly — put the intelligence in the client, keep the server simple. A POP3 server holds one flat maildrop per user. It has no folders, no shared read or unread state, and no way to tell a client that new mail has arrived on an open connection; RFC 1939 section 8 lists polling an open connection and multiple server-side folders among the IMAP capabilities that "are not present in POP3". The **Internet Message Access Protocol** (IMAP, now IMAP4rev2 in RFC 9051, August 2021, which obsoletes RFC 3501) takes the opposite view: the server holds the mailbox of record and each client is a window onto it. ## Why the phone never sees the mail A typical POP3 session from a desktop client set to download and delete runs like this: 1. The client connects and authenticates; the session moves from the **AUTHORIZATION** state to the **TRANSACTION** state. 2. It lists the maildrop (`STAT`, `LIST`) and downloads each message with `RETR`. 3. It marks each downloaded message with `DELE`. Nothing is removed yet. 4. It sends `QUIT`. The session enters the **UPDATE** state, and the server removes every marked message. When the phone polls ten minutes later, the maildrop holds only what arrived since the desktop's last session. The messages exist, but only in the desktop's local store. From the user's point of view the mail "vanished" — in fact one device took it away. Nothing was synchronised, because POP3 has nothing to synchronise with: the server forgets a message once it is removed. Two side effects follow from the same design: - **Whichever device polls first wins.** If the phone happens to connect before the desktop, the phone gets the message and the desktop never sees it. - **Concurrent sessions can collide.** RFC 1939 has the server take an exclusive-access lock on the maildrop as necessary while a session is open, so a second device connecting at the same moment may get `-ERR` (the RFC's example reads "maildrop already locked") and has to retry. ## What IMAP does instead With IMAP, the desktop and the phone both open the same server-side mailbox. Messages stay on the server until a user deletes them, folders live on the server, and per-message state such as "read" or "deleted" is stored there, so each device shows the same picture. How those flags and the resynchronisation between devices work is covered with IMAP flags and multi-device sync; for this choice it is enough that the state lives on the server, not in each client. POP3 can soften its model with **leave-on-server**: the client skips `DELE` and remembers each message's `UIDL` unique-id so it does not download it twice. That lets both devices receive every message, but it is only a partial imitation — reading, filing or deleting on one device still does not show up on the other. ## The ports | Protocol | Cleartext port (upgrade command) | Implicit-TLS port | |---|---|---| | POP3 | `110` (`STLS`, RFC 2595) | `995` ("pop3s") | | IMAP | `143` (`STARTTLS`) | `993` ("imaps") | RFC 8314 (January 2018, "Cleartext Considered Obsolete") recommends implicit TLS on `995` and `993` in preference to upgrading a cleartext connection, and asks providers to deprecate cleartext access as soon as practicable. It deprecates cleartext; it does not remove ports `110` or `143` from the protocols. ## What to configure - For anyone reading one mailbox on several devices, configure **IMAP on 993** on every device. - If a device must stay on POP3, use **995**, and either let it be the only POP3 client or switch it to leave-on-server so it stops emptying the maildrop for the others. - To tell what a client is doing, look at its account settings (protocol and port) and at the server's login log: a burst of `RETR` and `DELE` followed by `QUIT` from one address is the device that drains the box. - Mail already downloaded and deleted by POP3 is not on the server any more; switching that desktop to IMAP will not bring it back, so its local store has to be kept or uploaded.

  • If the desktop is switched to leave mail on the server, is the problem solved?
    Partly. With leave-on-server the desktop skips `DELE` and tracks each message's `UIDL` unique-id, so the phone can download the same messages too. But POP3 keeps no shared state: a message read, filed or deleted on the desktop still looks new on the phone, folders are local to each device, and an unbounded maildrop grows on the server. It imitates IMAP's server-side mailbox only for the 'everyone receives everything' part.
  • Which ports should a new POP3 or IMAP account use today?
    The implicit-TLS ports: `995` for POP3 and `993` for IMAP. RFC 8314 (January 2018) prefers them to connecting on the cleartext ports `110` and `143` and upgrading with `STLS` or `STARTTLS`, and asks providers to deprecate cleartext access. Clients MUST validate the server certificate under RFC 7817, and RFC 8314 says they should not send a password over a connection that fails that check.
  • Why might the desktop and the phone get an error when they check the same POP3 mailbox at the same moment?
    RFC 1939 has the server take an exclusive-access lock on the maildrop, as necessary, when a session enters the TRANSACTION state, so messages cannot change under a session before its UPDATE state. A second session arriving meanwhile can be refused with `-ERR` and must retry later. IMAP is designed for several clients on one mailbox at once.

  • POP3 can never leave messages on the server.
  • The phone lost the mail because POP3 synchronises deletions between devices.
  • IMAP downloads and deletes messages just like POP3, only faster.
  • Port 995 is IMAP over TLS and 993 is POP3 over TLS.
  • Port 110 is acceptable for POP3 as long as the password is strong.
open as a page

Under RFC 1939, when does a POP3 DELE actually remove a message, and what happens if the connection drops before QUIT?

level: middleimportance: should knowfreq 34%

basics

~20 s

DELE only marks a message; the server removes marked messages when QUIT moves the session from TRANSACTION into the UPDATE state. If the connection drops or times out first, the session never enters UPDATE and nothing is removed.

open as a page

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%

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.

open as a page

Should an office keep any POP3 access when staff read mail on several devices, and which POP3 and IMAP ports would you leave open?

level: principalimportance: should knowfreq 16%

basics

~20 s

Usually make IMAP on 993 the default and retire POP3 for people; keep POP3 only on 995 for a named single-consumer case, such as a system draining a mailbox, and close cleartext 110 and 143 once nothing needs them.

open as a page

How does a POP3 client leave mail on the server using UIDL, and why does that only partly imitate IMAP's server-side mailbox?

level: seniorimportance: nice to knowfreq 20%

basics

~20 s

The client skips DELE and records each message's UIDL unique-id, downloading only ids it has not seen. The server keeps one flat maildrop with no shared read state or folders, so read state and filing never carry from one device to another.

open as a page