rfc-8970

IMAP4 Extension: Message Preview Generation

M. Slusarz
date2020-12 streamIETF areaart wgextra statusPROPOSED STANDARD pages10 canonicalhttps://www.rfc-editor.org/rfc/rfc8970 doi10.17487/RFC8970
This document specifies an Internet Message Access Protocol (IMAP) protocol extension that allows a client to request a server-generated abbreviated text representation of message data that is useful as a contextual preview of the entire message.

Extracted elements (20)

design-rationale §1

Server-side preview generation is preferred over client-side because: (1) it enables consistent representation across all clients; (2) it is more efficient — client-side requires non-pipelineable FETCH BODYSTRUCTURE then FETCH BODY commands; (3) it enables centralized caching so preview is generated once per message for its entire retention period.

email

design-rationale §3.3

The 200/256 character limits for preview text were chosen to balance support for various languages with different average word lengths and diverse client display size requirements, while hard-capping at 256 to bound server resource use.

email

design-rationale §3.2

The relaxed immutability requirement (servers SHOULD strive for consistent previews but clients MUST NOT assume immutability) permits servers to offer previews without burdensome storage or processing guarantees, since preview approximation does not require the strictness of canonical message content.

email

interoperability-note §3.3

When preview is not generated from message body content and the LANGUAGE extension (RFC 5255) is supported, the preview text SHOULD be generated according to language rules for human-readable text, enabling appropriate localization of auto-generated descriptions (e.g., for image-only messages).

email

normative-requirement §3.2 MUST NOT

A client MUST NOT assume that a message preview is immutable for a given message, since previews are an approximation and server implementations may change over time.

email

normative-requirement §4.2 SHOULD NOT

A client SHOULD NOT continually issue FETCH PREVIEW requests with the LAZY modifier in a selected mailbox, as the server is under no requirement to return preview information for this command, which could waste system and network resources.

email

normative-requirement §3.2 MUST NOT

A server MUST NOT return NIL to a FETCH PREVIEW request made without the LAZY modifier. NIL is only permitted as a response when the LAZY modifier is used and preview generation would cause undue delay.

email

normative-requirement §4.2 RECOMMENDED

It is RECOMMENDED that FETCH requests for unavailable previews (those returned NIL under LAZY) be issued in small batches, e.g., 50 messages per FETCH command, since preview generation may be expensive.

email

normative-requirement §3.3 MUST

Preview text MUST be treated as text/plain media type data by the client, MUST NOT be content transfer encoded, and MUST be encoded in UTF-8.

email

normative-requirement §4.1 MUST

The LAZY modifier MUST be implemented by any server that supports the PREVIEW extension.

email

normative-requirement §3.3 MUST NOT

The server MUST NOT output preview text longer than 256 preview characters, where a preview character is a single UCS character encoded in UTF-8 (which may comprise multiple octets).

email

normative-requirement §3.3 SHOULD

The server SHOULD limit preview text length to 200 preview characters to support various languages and diverse client display size requirements.

email

normative-requirement §3.3 SHOULD

The server SHOULD remove formatting markup (e.g., HTML tags) and perform processing useful for rendering the preview as plain text.

email

normative-requirement §3.2 MUST

When no meaningful preview can be generated (e.g., for encrypted messages or unsupported content types), the server MUST return a zero-length string. Clients SHOULD NOT send another FETCH for a preview for such messages.

email

protocol-element §4.1

The LAZY modifier directs the server to return the preview only if it can be provided without undue delay. If the server cannot comply without undue delay, it MUST return NIL. The LAZY modifier MUST be implemented by any server that supports the PREVIEW extension.

email

protocol-element §3.1

The PREVIEW FETCH attribute is a new IMAP FETCH data item that clients use to request a server-generated abbreviated text preview of a message. The server returns a variable-length string intended for display to the user as contextual preview of the entire message.

email

registry §7

IANA has added the "PREVIEW" capability to the IMAP Capabilities registry. IMAP capabilities are registered by publishing a Standards Track or IESG-approved Experimental RFC.

email, registry

security-consideration §8 MUST

If generated preview data is stored on the server for caching, these previews MUST be protected with equivalent authorization and confidentiality controls as the source message, since previews may contain sensitive information.

email, security, privacy

security-consideration §8

Preview generation may enable denial-of-service attacks via excessive memory, CPU, or storage usage. Servers SHOULD log the client authentication identity on FETCH PREVIEW operations to facilitate tracking of abusive clients, and MAY limit resources used for preview generation.

email, security

wire-format §6

The PREVIEW FETCH attribute syntax is defined as: fetch-att =/ "PREVIEW" [SP "(" preview-mod *(SP preview-mod) ")"]. The response uses msg-att-dynamic =/ "PREVIEW" SP nstring, where nstring allows NIL (only when LAZY is used). The only defined modifier is "LAZY".

email