Somewhere in the late 1990s an IMAP client sent a line that stopped mid-thought:

C: A001 LOGIN {11}

Then it waited. Not for bandwidth — TCP had plenty. Not for disk, CPU or a mailbox lock. It waited for one character from the server, +, which meant: go on, eleven octets of user name, now.

That pause is the entire history of IMAP literals in miniature. A literal is a counted string: the client announces {n}, exactly n raw octets follow, and ordinary command grammar resumes immediately after the last one. In the original protocol the client had to stop at the count and ask permission. In January 1997, RFC 2088 let it write a plus sign and keep going. In May 2016, RFC 7888 published a standard whose real job was deciding what that shortcut had cost — and put a 4096-octet ceiling on it.

The lesson was never about latency. It is about who holds the right to say no, and who quietly picks up the bill when that right is handed away.

The short version

  • Original IMAP literals were count-framed strings embedded inside a command. A client declared {n}, received a + continuation, and only then sent the next n octets plus whatever command syntax remained.
  • RFC 2088's LITERAL+ changed the marker to {n+} and deleted that continuation round trip. The latency saving also meant an unwilling server might have to drain bytes it had already authorised, or close the connection.
  • RFC 7888's LITERAL- kept the same wire marker but capped unsolicited literals at 4096 octets. APPENDLIMIT separately exposed global or mailbox-specific upload policy; RFC 9051 later folded the restricted form into IMAP4rev2.

A line that ended before the command did

Look again at that LOGIN. The CRLF after the brace count looks like the end of a line. It is not the end of the command. The client has promised that eleven octets of a string will follow, and it is required to wait. Only after a server response beginning with + may those octets cross the connection, followed by the rest of LOGIN.

This is not a delimiter convention. A literal may contain CR and LF itself. Its end is fixed by the announced octet count, and command grammar resumes the instant the last counted octet lands. A space may introduce another argument; a later CRLF may finally finish the command. The receiver therefore has to hold two facts at once: how many raw octets remain, and where ordinary parsing picks up again.

RFC 2060, published in December 1996, described the literal as IMAP4rev1's general string form. RFC 3501, Mark Crispin's 2003 revision, carried the rule forward unchanged. Server-to-client literals could follow their count immediately. Client-to-server literals could not. Direction changed authority, because the server — not the client — owned admission to the command-processing and storage resources sitting behind the socket.

Even {0} had to wait. Approving zero octets saves no payload time whatsoever. The pause existed because it was a protocol decision point, not because the wire needed breathing room.

The continuation was a narrow veto

The + response meant the server was ready for more of this command. It did not accept the command's final meaning. A later argument could still be invalid; an APPEND could still fail; authentication could still be refused. The continuation merely stopped the client from committing bytes before the receiver had parsed enough context to invite them.

That invitation also made early error handling clean. If the server found a problem in the command prefix, it could send a tagged BAD completion instead of +. The client then had to stop sending that command. No unwanted literal had entered the byte stream, so the next command boundary stayed unambiguous.

This is not transport flow control. A TCP window says how much stream data the receiving stack can buffer. It knows nothing about mailbox names, IMAP verbs, quotas or string positions. The IMAP continuation was an application-level judgement about one syntactic continuation. TCP could have ample capacity while IMAP still said: not yet.

The design bought certainty at the price of a network turn. On a local link the pause is barely visible. Across a high-latency path, every literal inserted a request-and-permission exchange inside a single command. A command carrying several literals could accumulate several such stops.

1997: a plus sign spends the round trip

January 1997 brought RFC 2088, written by John G. Myers of Netscape, and with it the LITERAL+ capability and one very small grammar change:

{11+}

If the server advertised LITERAL+, the client could use this non-synchronising form. No continuation would come; no wait was required before the eleven octets went out. If the capability was absent, the client kept the original synchronising form.

RFC 2088's own example makes the consequence concrete. A LOGIN carries one non-synchronising literal for the user name, then another for the password, and the client sends both without an intermediate server turn. The protocol has not become unframed: each count still determines exactly how many octets belong to its literal, and later syntax remains part of the same command. What disappeared was permission at the boundary.

Capability negotiation mattered because {n+} was a promise about receiver behaviour. A server that had never agreed to recognise the plus form might parse it as an error, and could not be assumed to drain the following bytes correctly. Voluntary adoption let the optimisation spread without redefining every existing endpoint at once.

RFC 2088's security section said no security issues were known. That sentence captured what the extension's authors could close in 1997. It did not settle what operating experience would later reveal about resource custody.

Bytes already in flight are harder to refuse

The original sequence let a server inspect the command prefix and reject it before the literal arrived. LITERAL+ deliberately gave that opportunity away. If a client announced a very large {n+} and immediately streamed the data, the server could decide the command should fail while the client was still entitled to send all n octets.

RFC 7888, published in May 2016 by Alexey Melnikov and Brandon Long, describes the two unattractive choices. The server can read the specified bytes, discard them and reject the command — preserving stream synchronisation while wasting bandwidth and receiver work. Or it can send BYE and close the connection, forcing a reconnect and making the error harder for a user or a naïve client to understand. A server may send BAD or NO before it has drained the literal, but the octets do not vanish merely because the verdict arrived early.

APPEND made the problem sharp. Most IMAP arguments are modest. APPEND can carry an entire message and its attachments. Implementations may impose literal-size limits to protect memory, storage and processing. With unrestricted LITERAL+, a latency optimisation could cause a large body to arrive before the server had any practical way to refuse its cost.

That is a change in liability. The client gained time by acting without a fresh reply. The server inherited the cleanup problem the moment that action crossed a local limit. The syntax stayed deterministic; the operational burden moved.

2016: LITERAL- draws a line without changing the marker

RFC 7888 obsoleted RFC 2088 and specified two capabilities. LITERAL+ retained unrestricted non-synchronising literals. LITERAL- used the same {n+} form but imposed a ceiling: a non-synchronising literal must not exceed 4096 bytes. Anything larger returns to the synchronising {n} form.

The minus sign lives in the advertised capability, not in each literal. A server must not advertise LITERAL+ and LITERAL- together. Once the client has seen the capability, the plus inside {n+} means either “unrestricted by this extension” or “permitted only through 4096,” depending on the negotiated contract.

That separation is subtle and useful. The grammar stayed small. Old synchronising literals remained valid. Small strings could skip a round trip. Large strings recovered an explicit admission point before consuming substantial resources. The standard did not try to calculate a perfect threshold for every server or mailbox. It created a universal maximum for one permissionless mechanism.

The number is not an upload quota. A 3000-octet APPEND can still fail; a 20-megabyte APPEND can be accepted after synchronisation. LITERAL- answers only whether this literal may arrive without a continuation.

Nor does LITERAL- make abusive clients harmless. RFC 7888 says non-synchronising literals can consume memory and support denial-of-service attacks, and that the restricted extension only partially improves the situation. Many small literals, expensive parsing or repeated connections can still impose cost. A threshold narrows one exposure; it does not replace resource governance.

APPENDLIMIT answers a different size question

The same month produced RFC 7889, the APPENDLIMIT extension. Its concern was not how a string is framed but whether a message upload exceeds a server's known policy.

A capability such as APPENDLIMIT=257890 can advertise one maximum for all mailboxes. Bare APPENDLIMIT tells the client it can discover mailbox-specific values using STATUS or LIST-STATUS. A mailbox may report a number or NIL. A cooperative client can then avoid attempting an APPEND already known to be too large.

The distinction matters. LITERAL-'s 4096 is a protocol-wide ceiling on non-synchronising literal syntax. APPENDLIMIT can be far larger, can differ by mailbox, and applies to the message-upload decision. It can prevent waste before either synchronising or non-synchronising transfer begins.

APPENDLIMIT is evidence, not a reservation. RFC 7889 says the calculation should be quick and need not include ACLs, quotas or other conditions. A message below the advertised value can still fail. If the limit is unknown, the RFC advises a client to avoid non-synchronising literals for APPEND. Uncertainty restores the permission turn.

This division follows a durable Internet design pattern. Keep the common grammar rule narrow and deterministic; let operational policy stay local and discoverable. A single magic number could never have represented both jobs honestly.

IMAP4rev2 makes the restricted form ordinary

RFC 9051, published in August 2021 by Melnikov and Leiba, folded LITERAL- semantics into IMAP4rev2. It presents synchronising literals, non-synchronising literals and quoted strings as the three forms of a string. Unless another extension says otherwise, non-synchronising literals are limited to 4096 octets; larger ones synchronise.

The integration changes the historical posture. What began as an optional 1997 optimisation, then received a 2016 resource boundary, became part of the current base grammar. Yet both forms survive. The newer protocol did not declare waiting obsolete. It kept waiting precisely where advance permission remains valuable.

The IANA IMAP Capabilities registry still lists LITERAL+, LITERAL- and APPENDLIMIT with their standards references. Registration says what tokens mean. It does not show which servers advertise them today, how often clients choose each form, or what performance and abuse outcomes follow.

The real history is about who may commit the next byte

It is easy to file LITERAL+ as a minor latency fix and LITERAL- as a later safety limit. The deeper sequence is about decision rights.

The original literal let the receiver decide at every boundary. LITERAL+ let a capable server delegate that decision to the client in advance. The client used the delegation by adding one plus sign and sending immediately. RFC 7888 then limited the scope of that delegation once large unsolicited data made refusal expensive. APPENDLIMIT supplied a different kind of prior evidence, so the client could avoid a known policy failure altogether.

No form proved final acceptance. No count reserved storage. No capability measured trust. The standards kept each assertion small: exact framing, readiness for continuation, permission to skip the continuation, a fixed ceiling on that permission, or a reported upload limit.

The bytes that waited were not inefficient by accident. Their pause preserved a place where one system could still say no before the other spent its resources. Removing a round trip took one character. Working out who pays for its removal took nineteen years — and the answer was never a number. It was a place in the protocol where someone can still refuse.

Sources and evidence limits

These sources establish the protocol grammar, capability history and specified resource considerations. They do not measure present adoption, product behaviour, latency savings, attack frequency or mailbox policy in any deployed service. A continuation is not final command acceptance; 4096 is not an upload quota; APPENDLIMIT is not a promise that a smaller APPEND will succeed.