skip to content

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%

answer

  1. skip DELE, remember what you fetched
  2. per-session numbers versus persistent ids
  3. no shared read state
  4. server retention policy, EXPIRE

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.

solid answer

~50 s

Leave-on-server is a client behaviour built from two POP3 facts. The client simply never sends `DELE` (or sends it only after some number of days), and it uses `UIDL` — an optional RFC 1939 command — to get each message's **unique-id**, a server-chosen string of 1 to 70 printable characters that persists across sessions. Message numbers are reassigned every session, so the unique-id is what lets the client skip mail it already holds. RFC 1939 itself calls this a "weak version" of IMAP's semi-permanent repository: every device receives every message, but the server still keeps no read, answered or deleted state per device, no folders and no push, so reading or filing on one device never shows on another. Retention is also the server's call — a site may delete mail anyway, which a server can announce with the `EXPIRE` capability from RFC 2449.

go deeper

for a junior

Know that a POP3 client can leave copies on the server so a second device also receives them, and that it is a client setting.

for a middle

Explain the roles of skipping DELE and of UIDL, and why per-session message numbers cannot do the job of persistent unique-ids.

for a senior

Show where the imitation breaks: no shared read state, no folders, no push, and deletions only as disappearance. Read EXPIRE and site retention before promising users their mail stays.

for a principal

Judge when tuning leave-on-server is a false economy against moving the mailbox to IMAP, counting server storage, support tickets and user expectations.

## The mechanism POP3 (RFC 1939) was designed for download-and-delete, but nothing forces a client to delete. **Leave-on-server** combines two things: 1. **No `DELE`.** The client retrieves messages with `RETR` and ends with `QUIT` without marking anything, so the UPDATE state removes nothing. Some clients send `DELE` later, after a configured number of days, or when the user deletes the local copy. 2. **`UIDL` to remember what it has.** In the TRANSACTION state, `UIDL` returns a *unique-id listing*: each message number followed by its unique-id. The client stores the ids it has downloaded and, next session, fetches only the new ones. In RFC 1939, `UIDL` sits among the optional commands; a server announces support through the `UIDL` capability in its `CAPA` response (RFC 2449). ## Why the unique-id and not the message number Message numbers are assigned when the maildrop is opened — `1` is the first message of *this* session — so they shift as mail is added or removed. RFC 1939 sets firm rules for the unique-id: - it is 1 to 70 characters in the range `0x21`–`0x7E`, chosen by the server; - it identifies a message within a maildrop and **persists across sessions**, even when a session ends without entering UPDATE; - the server should never reuse an id in that maildrop; - it may be computed as a hash of the message, so two identical copies can share one id, and clients should cope with that. That persistence is what makes leave-on-server, and safe recovery after a dropped session, possible. ## What it does not imitate RFC 1939 section 8 is candid: UIDL without DELE gives "a weak version of the 'maildrop as semi-permanent repository' functionality normally associated with IMAP", and IMAP's other capabilities "are not present in POP3". | Need | POP3 leave-on-server | IMAP | |---|---|---| | Every device receives every message | Yes, via `UIDL` | Yes | | Read or answered state shared between devices | No — each client keeps its own | Yes, stored on the server | | Server-side folders | No — one flat maildrop | Yes | | New mail signalled on an open connection | No — the client polls | Yes | | Delete on one device seen by the others | Only as disappearance from later downloads | Yes | How IMAP stores those flags and resynchronises devices is covered with IMAP flags and multi-device sync. The point here is the asymmetry: when a user deletes a message locally and the client then sends `DELE`, the message leaves the server for everyone, but devices that already downloaded it keep their copy, and nothing tells them it was deleted. ## Retention: the server decides Leaving mail on the server is a request, not a guarantee. - RFC 1939 lets a site enforce its own retention policy — its example deletes unread mail after 60 days and read mail after 7 — and says such deletions are outside the protocol and not a violation. - RFC 2449 added the **`EXPIRE`** capability so the server can say what it will do: `EXPIRE NEVER` (it does not delete), `EXPIRE 30` (at least 30 days), or `EXPIRE 0` — leaving mail is not permitted, and at UPDATE the server MAY treat each message downloaded with `RETR` as if `DELE` had been sent. A `USER` suffix means the value may differ after login. - Unbounded accumulation is the operator's problem: RFC 1939 notes POP3 cannot handle maildrops of hundreds or thousands of messages efficiently, and suggests quotas or retention policies — each with its own cost to users. ## What to configure and check - Confirm the server advertises `UIDL` and read its `EXPIRE` value from `CAPA` (re-issue `CAPA` after login if the value carries `USER`). - Set a bounded "remove from server after N days" on the one device that acts as the archive, and plain leave-on-server on the others. - Tell users what will not sync: read state, folders, and deletions already downloaded elsewhere. - If staff genuinely need the same mailbox everywhere, the honest fix is IMAP rather than more leave-on-server tuning; a help-desk lead should expect each device to keep its own idea of what is read until then.

  • What does deleting a message on one device do to the other devices under POP3 leave-on-server?
    If that client then sends `DELE` and a clean `QUIT`, the message leaves the server, so devices that had not yet downloaded it never get it. Devices that already downloaded it keep their local copy and are never told it was deleted, because POP3 keeps no per-message state to synchronise. If the client deletes only locally, the other devices are unaffected.
  • How can a client learn whether a POP3 server will actually keep mail it leaves behind?
    From the `EXPIRE` capability in the `CAPA` response (RFC 2449). `EXPIRE NEVER` says the server does not delete, a number gives the minimum retention in days, and `EXPIRE 0` says mail may not be left — the server MAY treat each `RETR`-downloaded message as deleted at UPDATE. A trailing `USER` means a more accurate value is available after login.
  • Why do large leave-on-server maildrops worry the operator as well as the user?
    RFC 1939 section 8 observes that read mail accumulates on the server without bound and that POP3's limited commands do not handle maildrops of hundreds or thousands of messages efficiently — each session lists every message again. It suggests per-user quotas or a site retention policy, while warning that quotas can stop new mail arriving and that retention policies can surprise users.

  • Leaving mail on the server makes POP3 behave exactly like IMAP.
  • UIDL tells the server which messages each device has already read.
  • The message number from LIST is stable enough to track mail between sessions.
  • If the client never sends DELE, the server must keep the mail forever.
  • Two identical copies of a message always receive different UIDL unique-ids.