Internet Message Access Protocol - CONVERT Extension
Extracted elements (29)
Clients MUST NOT assume that repeating a particular body part conversion in another IMAP session yields the same result, to allow for upgrade of server transcoding components. Sizes and format of converted parts may differ across sessions.
The BINARY.SIZE value must be exact (not estimated) because prior experience with IMAP servers returning estimated RFC822.SIZE values caused interoperability problems: sizes smaller than actual caused data truncation with partial downloads, and sizes larger than actual misled clients about available storage.
Conversion parameter names are case-insensitive per the registry established by RFC 2506 (MEDIAFEAT-REG). The CONVERT extension reuses RFC 3516 (IMAP Binary) section-binary syntax for section references, but unlike RFC 3516, conversion of top-level multipart/* parts is allowed.
A server claiming compliance with CONVERT MUST support the IMAP Binary specification (RFC 3516).
A server implementing CONVERT MUST support charset conversions for text/plain, including conversions from iso-8859-1 through iso-8859-8 and iso-8859-15 to utf-8.
A server that supports the CONVERT extension MUST return "CONVERT" and "BINARY" in the CAPABILITY response or response code.
Conversions only affect what is sent to the client; the original data in the message store MUST NOT be altered.
CONVERT never sets the \Seen flag on converted messages; a client wishing to mark a message seen must issue a separate STORE command.
For BODY[HEADER], BODY[section.HEADER], or BODY[section.MIME] conversions, a CHARSET parameter MUST be included; the server MUST decode RFC 2047 encoded words and return them re-encoded in the specified charset.
If at least one conversion succeeds in a multi-part request, the server MUST return an OK response. If all conversions fail, the server MAY return OK or NO.
If the server cannot perform charset conversion while preserving all characters and the 'unknown-character-replacement' parameter is not specified, the server MUST fail the conversion and MUST return ERROR BADPARAMETERS.
If the server is unable to perform conversion due to a temporary resource unavailability, it MUST return a tagged NO response that SHOULD contain the TEMPFAIL response code.
If the server refuses a conversion because the request lists too many messages, it MUST return the MAXCONVERTMESSAGES response code. If too many body parts are requested at once, it MUST return the MAXCONVERTPARTS response code.
Servers are REQUIRED to support "default conversion" requests (where client specifies NIL as the target MIME type and server picks a suitable target). Server implementations supporting multiple target MIME types SHOULD make the default conversion configurable.
The BINARY.SIZE value MUST be exact and MUST NOT change during an IMAP session. Clients MUST NOT cache sizes of converted body parts beyond the duration of a session or use sizes from one connection in another.
The server MUST respect the target MIME type and conversion parameters specified by the client in the transcoding request.
UID CONVERT MUST result in the UID data item in the corresponding CONVERTED response, and an EXPUNGE response MUST NOT be sent while responding to a CONVERT command.
Error responses use an ERROR phrase with a human-readable description followed by a convert-error-code: TEMPFAIL (retry later), BADPARAMETERS (invalid/unsupported parameters or conversion not possible), or MISSINGPARAMETERS (required parameters absent).
The AVAILABLECONVERSIONS[section-part] data item returns the list of target MIME types a given body part can be converted to; it MUST return a subset of what CONVERSIONS command returns, and must filter out types incompatible with specified conversion parameters.
The BODYPARTSTRUCTURE CONVERT data item returns the MIME structure of the converted body part (following RFC 3501 BODYSTRUCTURE syntax), reflecting the state after conversion. It MUST match the BINARY data returned for the same conversion in the same IMAP session.
The CONVERSION untagged response specifies which source MIME type can be converted to the target MIME type, and lists supported conversion parameters for that pair.
The CONVERSIONS command takes a source MIME type and target MIME type (both wildcardable with '*' or 'type/*') and returns untagged CONVERSION responses listing supported conversions and their parameters.
The CONVERT and UID CONVERT commands transcode a MIME part to another media type; they are structured similarly to FETCH/UID FETCH and return untagged CONVERTED responses. A single CONVERT command performs only one type of conversion; multiple conversions require multiple commands.
The CONVERTED untagged response begins with a message number, followed by a convert correlator containing the originating command's tag (for client-side matching), followed by one or more CONVERT return data items. UID MUST be the first data item if present.
IANA registered the CONVERT IMAP capability in the IMAP Capability registry, and added 'unknown-character-replacement' to the media feature tags registry (RFC 2506) with ASN.1 OID 1.3.6.1.8.1.33.
Clients SHOULD use mutual SASL authentication and the SASL/TLS integrity layer to ensure they communicate with a trusted server. Deployments using a separate transcoding server should keep it in the same trusted domain (e.g., subnet) as the IMAP server.
Conversions may present security threats including buffer overflows in media codecs, denial-of-service via requesting extremely large image scaling, or privilege escalation if the server's conversion library is vulnerable. Servers SHOULD refuse CPU-expensive conversions, SHOULD isolate conversion functions in a separate process, and SHOULD log client identity on APPEND and CONVERT operations.
When a client requests server-side conversion of a signed body part (e.g., inside multipart/signed), there is no way for the client to verify that the converted content is authentic. A client not trusting the server should download, verify, and convert locally.
The CONVERT command syntax is: 'CONVERT SP sequence-set SP convert-params SP (convert-att / "(" convert-att *(SP convert-att) ")")'. convert-params wraps the target MIME type (or NIL for default) and optional transcoding parameters in parentheses.