rfc-5255

Internet Message Access Protocol Internationalization

C. Newman, A. Gulbrandsen, A. Melnikov
date2008-06 streamIETF areaapp wgimapext statusPROPOSED STANDARD pages20 canonicalhttps://www.rfc-editor.org/rfc/rfc5255 doi10.17487/RFC5255 errataview
Internet Message Access Protocol (IMAP) version 4rev1 has basic support for non-ASCII characters in mailbox names and search substrings. It also supports non-ASCII message headers and content encoded as specified by Multipurpose Internet Mail Extensions (MIME). This specification defines a collection of IMAP extensions that improve international support including language negotiation for international error text, translations for namespace prefixes, and comparator negotiation for search, sort, and thread. [STANDARDS-TRACK]

Extracted elements (27)

design-rationale §4.1

I18NLEVEL=1 is a simpler version of I18NLEVEL=2 with no ability to select a different collation; it mandates i;unicode-casemap as the fixed comparator. I18NLEVEL=2 is a superset adding comparator negotiation via the COMPARATOR command, enabling locale-appropriate sorting.

email

design-rationale §3

IMAP human-readable text is limited to US-ASCII in RFC 3501 to preserve backwards compatibility. The LANGUAGE extension is designed as an opt-in negotiation so that only clients that explicitly request localization receive non-ASCII responses, avoiding breakage of deployed implementations.

email

design-rationale §5.2

The modified UTF-7 mailbox naming convention (RFC 3501 Section 5.1.3) is described as a transitional measure from 1996 when local character sets such as ISO-8859-1 and Shift-JIS were in unofficial use for mailbox names, causing non-interoperability. Full UTF-8 mailbox names are a future goal.

email

interoperability-note §4.5

Several server implementations deployed before this specification comply with I18NLEVEL=1 but do not advertise it; others use i;ascii-casemap. There is no reliable way for a client to determine which comparator a legacy server uses, potentially forcing expensive local operations.

email

interoperability-note §5.1

The IMAP LOGIN command userid and password fields are restricted to US-ASCII until a future standards-track RFC states otherwise. Servers are encouraged to validate both fields as valid UTF-8 and MAY reject LOGIN if either field contains an octet with the high bit set.

email

normative-requirement §4.4 MUST

A server advertising I18NLEVEL=2 MUST list I18NLEVEL=2 in its CAPABILITY data in authenticated state and MUST implement i;unicode-casemap. The default comparator MUST remain static for the remainder of a connection once the authenticated state is entered.

email

normative-requirement §3.1 MUST

A server advertising the LANGUAGE extension MUST use the language 'i-default' as its default language until another supported language is negotiated, and MUST include 'i-default' as one of its supported languages.

email

normative-requirement §4.2 MUST

A server that advertises I18NLEVEL=1 or I18NLEVEL=2 MUST implement the i;unicode-casemap comparator and MUST support UTF-8 as a SEARCH charset.

email

normative-requirement §4.3 MUST

An IMAP server satisfying I18NLEVEL=1 requirements MUST list the keyword I18NLEVEL=1 in its CAPABILITY data once IMAP enters authenticated state.

email

normative-requirement §3.1 MUST

Clients and servers that support the LANGUAGE extension MUST also support the NAMESPACE extension (RFC 2342).

email

normative-requirement §3.1 MUST

Clients SHOULD issue the LANGUAGE command before authentication, since some servers send valuable user information during authentication. If a security layer is subsequently negotiated, the client MUST re-issue LANGUAGE to prevent active attack effects on subsequent error messages.

email, security

normative-requirement §3.2 MUST

If a language range does not match a known language tag exactly but matches by the rules of RFC 4647, the server MUST send an untagged LANGUAGE response indicating the language selected.

email

normative-requirement §4.4 MUST

If the active collation does not provide the operations needed by an IMAP command (e.g., substring for SEARCH, ordering for SORT), the server MUST respond with a tagged BAD.

email

normative-requirement §3.2 MUST

If the LANGUAGE command succeeds, the server MUST send a LANGUAGE response specifying the language used, and responses will be in UTF-8. The change takes effect immediately after the LANGUAGE response.

email

normative-requirement §3.1 MUST

IMAP servers that support the LANGUAGE extension MUST list the keyword LANGUAGE in their CAPABILITY response as well as in the greeting CAPABILITY data.

email

normative-requirement §4.6 MUST

When performing collation, MIME encoding MUST be removed from texts being collated (step a), and the decoded text MUST be converted to the charset expected by the active comparator (step b). Failures at step b fall back to i;octet comparator.

email

protocol-element §4.2

The active comparator applies to SEARCH keys BCC, BODY, CC, FROM, SUBJECT, TEXT, TO, and HEADER; to SORT keys CC, FROM, SUBJECT, and TO; and to ORDEREDSUBJECT and REFERENCES threading algorithms.

email

protocol-element §4.9

The BADCOMPARATOR response code SHOULD be returned when the server fails an IMAP command with NO because none of the specified comparators match any requested comparator.

email

protocol-element §4.7

The COMPARATOR command (valid in authenticated and selected states) determines or changes the active comparator. With no arguments it returns the current active comparator; with arguments it changes the active comparator, with the first matching argument winning.

email

protocol-element §4.8

The COMPARATOR response returns the name of the active comparator as the first argument, and optionally a list of all comparators matching the COMPARATOR command arguments as the second argument (present only when more than one match is found).

email

protocol-element §3.2

The LANGUAGE command requests that human-readable text emitted by the server be localized to a language matching one of the language range arguments as described by RFC 4647 Section 2. It is valid in all states.

email

protocol-element §3.3

The LANGUAGE response contains a list of one or more language tags. A single-tag response indicates the server is now using that language; a multi-tag response communicates a list of available languages with no change to the active language.

email

protocol-element §3.4

The TRANSLATION extension to the NAMESPACE response returns a single modified UTF-7 encoded string containing the localized translation of a namespace prefix. The client is responsible for converting between the prefix and its translation when presenting mailbox names.

email

registry §6

IANA added LANGUAGE, I18NLEVEL=1, and I18NLEVEL=2 to the IMAP4 Capabilities Registry as defined by this specification.

email, registry

security-consideration §7

A LANGUAGE command issued before a security layer is active is subject to active attack that suppresses or modifies the negotiation, making STARTTLS or authentication error messages harder to interpret. Clients MUST re-issue LANGUAGE after a security layer is activated.

email, security

security-consideration §7

The LANGUAGE extension makes a new command available in 'Not Authenticated' state. Implementations running with root privilege in this state are particularly vulnerable to buffer overflow errors and must parse the LANGUAGE command with extra care.

email, security

wire-format §3.5

The namespace-trans production adds 'SP DQUOTE "TRANSLATION" DQUOTE SP "(" string ")"' to namespace responses, where the string is encoded in modified UTF-7. The resp-text rule is replaced after language change to allow UTF8-TEXT-CHAR (UTF-8 excluding 7-bit control characters and "[").

email