draft-ietf-imapext-i18n-06.txt   draft-ietf-imapext-i18n-07.txt 
Network Working Group Chris Newman Network Working Group Chris Newman
Request for Comments: DRAFT Sun Microsystems Request for Comments: DRAFT Sun Microsystems
draft-ietf-imapext-i18n-06.txt Arnt Gulbrandsen Arnt Gulbrandsen
Oryx Mail Systems Oryx Mail Systems GmhH
February 2006 November 2006
Internet Message Access Protocol Internationalization Internet Message Access Protocol Internationalization
draft-ietf-imapext-i18n-07.txt
Status of this Memo Status of this Memo
By submitting this Internet-Draft, each author represents that any By submitting this Internet-Draft, each author represents that any
applicable patent or other IPR claims of which he or she is aware applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79. aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet- other groups may also distribute working documents as Internet-
Drafts. Drafts.
skipping to change at page 2, line 5 skipping to change at page 2, line 5
Internet Message Access Protocol (IMAP) version 4rev1 has basic Internet Message Access Protocol (IMAP) version 4rev1 has basic
support for non-ASCII characters in mailbox names and search support for non-ASCII characters in mailbox names and search
substrings. It also supports non-ASCII message headers and content substrings. It also supports non-ASCII message headers and content
encoded as specified by Multipurpose Internet Mail Extensions encoded as specified by Multipurpose Internet Mail Extensions
(MIME). This specification defines a collection of IMAP extensions (MIME). This specification defines a collection of IMAP extensions
which improve international support including comparator negotiation which improve international support including comparator negotiation
for search, sort and thread, language negotiation for international for search, sort and thread, language negotiation for international
error text, and translations for namespace prefixes. error text, and translations for namespace prefixes.
Internet-draft February 2006 Internet-draft November 2006
Table of Contents Table of Contents
1. Conventions Used in this Document . . . . . . . . . . . . . . 3 1. Conventions Used in this Document . . . . . . . . . . . . . . 2
2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
3. LANGUAGE Extension . . . . . . . . . . . . . . . . . . . . . 3 3. LANGUAGE Extension . . . . . . . . . . . . . . . . . . . . . 3
3.1 LANGUAGE Extension Requirements . . . . . . . . . . . . . . . 3 3.1 LANGUAGE Extension Requirements . . . . . . . . . . . . . . . 3
3.2 LANGUAGE Command . . . . . . . . . . . . . . . . . . . . . . 4 3.2 LANGUAGE Command . . . . . . . . . . . . . . . . . . . . . . 4
3.3 LANGUAGE Response . . . . . . . . . . . . . . . . . . . . . . 5 3.3 LANGUAGE Response . . . . . . . . . . . . . . . . . . . . . . 5
3.4 TRANSLATION Extension to the NAMESPACE Response . . . . . . . 6 3.4 TRANSLATION Extension to the NAMESPACE Response . . . . . . . 6
3.5 Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 6 3.5 Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 6
4. COMPARATOR Extension . . . . . . . . . . . . . . . . . . . . 7 4. COMPARATOR Extension . . . . . . . . . . . . . . . . . . . . 7
4.1 COMPARATOR Extension Requirements . . . . . . . . . . . . . . 8 4.1 COMPARATOR Extension Requirements . . . . . . . . . . . . . . 8
4.2 Comparators and Charsets . . . . . . . . . . . . . . . . . . 9 4.2 Comparators and Charsets . . . . . . . . . . . . . . . . . . 8
4.3 COMPARATOR Command . . . . . . . . . . . . . . . . . . . . . 9 4.3 COMPARATOR Command . . . . . . . . . . . . . . . . . . . . . 9
4.4 COMPARATOR Response . . . . . . . . . . . . . . . . . . . . . 10 4.4 COMPARATOR Response . . . . . . . . . . . . . . . . . . . . . 10
4.5 Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 10 4.5 Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 10
5. Other IMAP Internationalization Issues . . . . . . . . . . . 11 5. Other IMAP Internationalization Issues . . . . . . . . . . . 11
5.1 UTF-8 Userids and Passwords . . . . . . . . . . . . . . . . . 11 5.1 UTF-8 Userids and Passwords . . . . . . . . . . . . . . . . . 11
5.2 UTF-8 Mailbox Names . . . . . . . . . . . . . . . . . . . . . 11 5.2 UTF-8 Mailbox Names . . . . . . . . . . . . . . . . . . . . . 11
5.3 UTF-8 Domains, Addresses and Mail Headers . . . . . . . . . . 12 5.3 UTF-8 Domains, Addresses and Mail Headers . . . . . . . . . . 11
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12
7. Security Considerations . . . . . . . . . . . . . . . . . . . 12 7. Security Considerations . . . . . . . . . . . . . . . . . . . 12
8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 13 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 12
9. Relevant Standards for i18n IMAP Implementations . . . . . . 13 9. Relevant Standards for i18n IMAP Implementations . . . . . . 13
Normative References . . . . . . . . . . . . . . . . . . . . 14 Normative References . . . . . . . . . . . . . . . . . . . . 13
Informative References . . . . . . . . . . . . . . . . . . . 14 Informative References . . . . . . . . . . . . . . . . . . . 14
Author's Address . . . . . . . . . . . . . . . . . . . . . . 15 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 15
Intellectual Property and Copyright Statements . . . . . . . 16 Intellectual Property and Copyright Statements . . . . . . . 16
Conventions Used in This Document Conventions Used in This Document
The key words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", and "MAY" The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
in this document are to be interpreted as defined in "Key words for "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
use in RFCs to Indicate Requirement Levels" [1]. document are to be interpreted as described in [RFC2119].
The formal syntax use the Augmented Backus-Naur Form (ABNF) [2] The formal syntax use the Augmented Backus-Naur Form (ABNF)
notation including the core rules defined in Appendix A of RFC 2234. [RFC4234] notation including the core rules defined in Appendix A.
The UTF8-related productions are defined in RFC 3629 [7]. The UTF8-related productions are defined in [RFC3629].
In examples, "C:" and "S:" indicate lines sent by the client and In examples, "C:" and "S:" indicate lines sent by the client and
server respectively. If a single "C:" or "S:" label applies to server respectively. If a single "C:" or "S:" label applies to
multiple lines, then the line breaks between those lines are for multiple lines, then the line breaks between those lines are for
editorial clarity only and are not part of the actual protocol editorial clarity only and are not part of the actual protocol
exchange. exchange.
Internet-draft February 2006 Internet-draft November 2006
2. Introduction 2. Introduction
This specification defines two IMAP4rev1 [6] extensions to enhance This specification defines two IMAP4rev1 [RFC3501] extensions to
international support. These extensions can be advertised and enhance international support. These extensions can be advertised
implemented separately. and implemented separately.
The LANGUAGE extension allows the client to request a suitable The LANGUAGE extension allows the client to request a suitable
language for protocol error messages and in combination with the language for protocol error messages and in combination with the
NAMESPACE extension [4] enables namespace translations. NAMESPACE extension [RFC2342] enables namespace translations.
The COMPARATOR extension allows the client to request a suitable The COMPARATOR extension allows the client to request a suitable
comparator which will modify the behavior of the base comparator which will modify the behavior of the base
specification's SEARCH command as well as the SORT and THREAD specification's SEARCH command as well as the SORT and THREAD
extensions [15]. This leverages the comparator registry [8]. extensions [SORT]. This leverages the comparator registry
[RFCxxxx].
3. LANGUAGE Extension 3. LANGUAGE Extension
IMAP allows server responses to include human-readable text that in IMAP allows server responses to include human-readable text that in
many cases needs to be presented to the user. But that text is many cases needs to be presented to the user. But that text is
limited to US-ASCII by the IMAP specification [6] in order to limited to US-ASCII by the IMAP specification [RFC3501] in order to
preserve backwards compatibility with deployed IMAP implementations. preserve backwards compatibility with deployed IMAP implementations.
This section specifies a way for an IMAP client to negotiate which This section specifies a way for an IMAP client to negotiate which
language the server should use when sending human-readable text. language the server should use when sending human-readable text.
The LANGUAGE extension only provides a mechanism for altering fixed The LANGUAGE extension only provides a mechanism for altering fixed
server strings such as response text and NAMESPACE folder names. server strings such as response text and NAMESPACE folder names.
Assigning localized language aliases to shared mailboxes would be Assigning localized language aliases to shared mailboxes would be
done with a separate mechanism such as the proposed ANNOTATEMORE done with a separate mechanism such as the proposed METADATA
extension. [16] extension (see [METADATA]).
3.1 LANGUAGE Extension Requirements 3.1 LANGUAGE Extension Requirements
IMAP servers that support this extension MUST list the keyword IMAP servers that support this extension MUST list the keyword
LANGUAGE in their CAPABILITY response as well as in the greeting LANGUAGE in their CAPABILITY response as well as in the greeting
CAPABILITY data. CAPABILITY data.
A server that advertises this extension MUST use the language "i- A server that advertises this extension MUST use the language "i-
default" as described in [3] as its default language until another default" as described in [RFC2277] as its default language until
supported language is negotiated by the client. A server MUST another supported language is negotiated by the client. A server
include "i-default" as one of its supported languages. MUST include "i-default" as one of its supported languages.
A client that supports this extension MUST be prepared for a A client that supports this extension MUST be prepared for a
possible NAMESPACE response [4] from the server. possible NAMESPACE response [RFC2342] from the server.
The LANGUAGE command is valid in all states. The LANGUAGE command is valid in all states.
Internet-draft February 2006 Internet-draft November 2006
3.2 LANGUAGE Command 3.2 LANGUAGE Command
Arguments: Optional language range argument. Arguments: Optional language range arguments.
Response: A possible LANGUAGE response (see Section 3.3). Response: A possible LANGUAGE response (see Section 3.3).
A possible NAMESPACE response as defined by [4].
Result: OK - Command completed Result: OK - Command completed
NO - Could not complete command NO - Could not complete command
BAD - arguments invalid BAD - arguments invalid
The LANGUAGE command requests that human-readable text emitted by The LANGUAGE command requests that human-readable text emitted by
the server be localized to a language matching the language range the server be localized to a language matching one of the language
argument as described by section 2.5 of RFC 3066. range argument as described by section 2.5 of RFC 3066.
If the command succeeds, the server will return human-readable If the command succeeds, the server will return human-readable
responses in the specified language starting with the tagged OK responses in the first supported language specified. The first
response to the LANGUAGE command. These responses will be in UTF-8 response affected by the change is the tagged OK response to the
[7]. LANGUAGE command. These responses will be in UTF-8 [RFC3629].
If the command fails, the server will continue to return human- If the command fails, the server will continue to return human-
readable responses in the language it was previously using. readable responses in the language it was previously using.
The client MUST NOT use MUL (Multiple languages) or UND The client MUST NOT use MUL (Multiple languages) or UND
(Undetermined) language tags and the server MUST return BAD if (Undetermined) language tags and the server MUST return BAD if
either tag is used. The special "*" language range argument either tag is used, even if other, legal, arguments are also
indicates a request to use a language designated as preferred by the supplied. The special "*" language range argument indicates a
server administrator. The preferred language MAY vary based on the request to use a language designated as preferred by the server
administrator. The preferred language MAY vary based on the
currently active user. currently active user.
If the language range does not match a known language tag exactly If a language range does not match a known language tag exactly but
but does match a language by the rules of section 2.5 of [5], the does match a language by the rules of [RFC4647], the server MUST
server MUST send an untagged LANGUAGE response indicating the send an untagged LANGUAGE response indicating the language selected.
language selected.
If the language range argument is omitted, the server SHOULD send an If there aren't any arguments, the server SHOULD send an untagged
untagged LANGUAGE response listing the languages it supports. If LANGUAGE response listing the languages it supports. If the server
the server is unable to enumerate the list of languages it supports is unable to enumerate the list of languages it supports it MAY
it MAY return a tagged NO response to the enumeration request. return a tagged NO response to the enumeration request.
< The server defaults to using English i-default responses until < The server defaults to using English i-default responses until
the user explicitly changes the language. > the user explicitly changes the language. >
C: A001 LOGIN KAREN PASSWORD C: A001 LOGIN KAREN PASSWORD
S: A001 OK LOGIN completed S: A001 OK LOGIN completed
< Client requested MUL language. Server MUST reply with BAD. > < Client requested MUL language. Server MUST reply with BAD. >
Internet-draft February 2006
C: A002 LANGUAGE MUL C: A002 LANGUAGE MUL
Internet-draft November 2006
S: A002 BAD Invalid language MUL S: A002 BAD Invalid language MUL
< A LANGUAGE command with no arguments is a request to enumerate < A LANGUAGE command with no arguments is a request to enumerate
the list of languages the server supports. > the list of languages the server supports. >
C: A003 LANGUAGE C: A003 LANGUAGE
S: * LANGUAGE (EN DE IT i-default) S: * LANGUAGE (EN DE IT i-default)
S: A003 OK Supported languages have been enumerated S: A003 OK Supported languages have been enumerated
C: B001 LANGUAGE C: B001 LANGUAGE
skipping to change at page 5, line 43 skipping to change at page 5, line 42
C: A005 LANGUAGE FR C: A005 LANGUAGE FR
S: A005 NO Diese Sprache ist nicht unterstuetzt S: A005 NO Diese Sprache ist nicht unterstuetzt
C: A006 LANGUAGE DE-IT C: A006 LANGUAGE DE-IT
S: * LANGUAGE (DE-IT) S: * LANGUAGE (DE-IT)
S: A006 OK Sprachwechsel durch LANGUAGE-Befehl ausgefuehrt S: A006 OK Sprachwechsel durch LANGUAGE-Befehl ausgefuehrt
C: A007 LANGUAGE "*" C: A007 LANGUAGE "*"
S: * LANGUAGE (DE) S: * LANGUAGE (DE)
S: A007 OK LANGUAGE-Befehl erfolgreich ausgefuehrt S: A007 OK LANGUAGE-Befehl erfolgreich ausgefuehrt
< Server does not speak French, but does speak English. User
speaks Canadian French and Canadian English. >
C: A008 LANGUAGE FR-CA EN-CA
S: * LANGUAGE (EN)
S: A008 OK Now speaking English
3.3 LANGUAGE Response 3.3 LANGUAGE Response
Contents: A list of one or more language tags. Contents: A list of one or more language tags.
Internet-draft November 2006
The LANGUAGE response occurs as a result of a LANGUAGE command. A The LANGUAGE response occurs as a result of a LANGUAGE command. A
LANGUAGE response with a list containing a single language tag LANGUAGE response with a list containing a single language tag
indicates that the server is now using that language. A LANGUAGE indicates that the server is now using that language. A LANGUAGE
response with a list containing multiple language tags indicates the response with a list containing multiple language tags indicates the
server is communicating a list of available languages to the client, server is communicating a list of available languages to the client,
and no change in the active language has been made. and no change in the active language has been made.
Internet-draft February 2006
3.4 TRANSLATION Extension to the NAMESPACE Response 3.4 TRANSLATION Extension to the NAMESPACE Response
If the server supports the IMAP4 NAMESPACE command [4], the server
MUST return an untagged NAMESPACE response when a language is
negotiated. However the server MUST NOT return a NAMESPACE response
if it is in not-authenticated state.
If as a result of the newly negotiated language, localized If as a result of the newly negotiated language, localized
representations of the namespace prefixes are available, the server representations of the namespace prefixes are available, the server
SHOULD include these in the TRANSLATION extension to the NAMESPACE SHOULD include these in the TRANSLATION extension to the NAMESPACE
response. response.
OPEN ISSUE: I would appreciate concrete suggestions about how to do
NAMESPACE better.
The TRANSLATION extension to the NAMESPACE response returns a single The TRANSLATION extension to the NAMESPACE response returns a single
string, containing the modified UTF-7 [6] encoded translation of the string, containing the modified UTF-7 [RFC3501] encoded translation
namespace prefix. It is the responsibility of the client to convert of the namespace prefix. It is the responsibility of the client to
between the namespace prefix and the translation of the namespace convert between the namespace prefix and the translation of the
prefix when presenting mailbox names to the user. namespace prefix when presenting mailbox names to the user.
In this example a server supports the IMAP4 NAMESPACE command. It In this example a server supports the IMAP4 NAMESPACE command. It
uses no prefix to the user's Personal Namespace, a prefix of "Other uses no prefix to the user's Personal Namespace, a prefix of "Other
Users" to its Other Users' Namespace and a prefix of "Public Users" to its Other Users' Namespace and a prefix of "Public
Folders" to its only Shared Namespace. Since a client will often Folders" to its only Shared Namespace. Since a client will often
display these prefixes to the user, the server includes a display these prefixes to the user, the server includes a
translation of them that can be presented to the user. translation of them that can be presented to the user.
C: A001 LANGUAGE DE-IT C: A001 LANGUAGE DE-IT
S: * NAMESPACE (("" "/"))(("Other Users/" "/" "TRANSLATION" S: * NAMESPACE (("" "/"))(("Other Users/" "/" "TRANSLATION"
("Andere Ben&APw-tzer/"))) (("Public Folders/" "/" ("Andere Ben&APw-tzer/"))) (("Public Folders/" "/"
"TRANSLATION" ("Gemeinsame Mailboxen/"))) "TRANSLATION" ("Gemeinsame Mailboxen/")))
S: A001 OK LANGUAGE-Befehl ausgefuehrt S: A001 OK LANGUAGE-Befehl ausgefuehrt
3.5 Formal Syntax 3.5 Formal Syntax
The following syntax specification inherits ABNF [2] rules from The following syntax specification inherits ABNF [RFC4234] rules
IMAP4rev1 [6], IMAP4 Namespace [4], Tags for the Identification of from IMAP4rev1 [RFC3501], IMAP4 Namespace [RFC2342], Tags for the
Languages [5], and UTF-8 [7]. Identifying Languages [RFC4646], and UTF-8 [RFC3629].
command-any =/ language-cmd command-any =/ language-cmd
; LANGUAGE command is valid in all states ; LANGUAGE command is valid in all states
language-cmd = "LANGUAGE" [SP lang-range-quoted] language-cmd = "LANGUAGE" *(SP lang-range-quoted)
language-data = "LANGUAGE" SP "(" lang-tag-quoted *(SP lang- Internet-draft November 2006
tag-quoted) ")"
Internet-draft February 2006 response-payload =/ language-data / comparator-data
namespace-trans = SP DQUOTE "TRANSLATION" DQUOTE SP "(" string language-data = "LANGUAGE" SP "(" lang-tag-quoted *(SP lang-tag-
")" quoted) ")"
namespace-trans = SP DQUOTE "TRANSLATION" DQUOTE SP "(" string ")"
; the string is encoded in Modified UTF-7. ; the string is encoded in Modified UTF-7.
; this is a subset of the syntax permitted by ; this is a subset of the syntax permitted by
; the Namespace_Response_Extension rule in RFC 2342 ; the Namespace_Response_Extension rule in [RFC2342]
lang-range-quoted = astring lang-range-quoted = astring
; Once any literal wrapper or quoting is removed, this ; Once any literal wrapper or quoting is removed, this
; follows the language-range rule in section 2.5 of RFC 3066 ; follows the language-range rule in [RFC4647]
lang-tag-quoted = astring lang-tag-quoted = astring
; Once any literal wrapper or quoting is removed, this ; Once any literal wrapper or quoting is removed, this follows
follows ; the Language-Tag rule in [RFC4646]
; the Language-Tag rule in section 2.1 of RFC 3066
; After the server is changed to a language other than
; i-default, the resp-text rule from RFC 3501 is replaced
; with the following:
resp-text = ["[" resp-text-code "]" SP ] UTF8-TEXT-CHAR resp-text = ["[" resp-text-code "]" SP ] UTF8-TEXT-CHAR
*(UTF8-TEXT-CHAR / "[") *(UTF8-TEXT-CHAR / "[")
; After the server is changed to a language other than
; i-default, this resp-text rule replaces the resp-text
; rule from [RFC3501].
UTF8-TEXT-CHAR = %x20-%x5A / %x5C-%x7E / UTF8-2 / UTF8-3 / UTF8-TEXT-CHAR = %x20-%x5A / %x5C-%x7E / UTF8-2 / UTF8-3 / UTF8-4
UTF8-4
; UTF-8 excluding 7-bit control characters and "[" ; UTF-8 excluding 7-bit control characters and "["
4. COMPARATOR Extension 4. COMPARATOR Extension
IMAP4rev1 [6] includes the SEARCH command which can be used to IMAP4rev1 [RFC3501] includes the SEARCH command which can be used to
locate messages matching criteria including human-readable text. locate messages matching criteria including human-readable text.
The SORT extension [15] to IMAP allows the client to ask the server The SORT extension [SORT] to IMAP allows the client to ask the
to determine the order of messages based on criteria including server to determine the order of messages based on criteria
human-readable text. These mechanisms require the ability to including human-readable text. These mechanisms require the ability
support non-English search and sort functions. to support non-English search and sort functions.
This section defines an IMAP extension to negotiate use of This section defines an IMAP extension to negotiate use of
comparators [8] to internationalize IMAP SEARCH, SORT and THREAD. comparators [RFCxxxx] to internationalize IMAP SEARCH, SORT and
The IMAP extension consists of a new command to determine or change THREAD. The IMAP extension consists of a new command to determine
the active comparator and a new response to indicate the active or change the active comparator and a new response to indicate the
comparator and possibly other available comparators. active comparator and possibly other available comparators.
The term "default comparator" refers to the comparator which is used The term "default comparator" refers to the comparator which is used
by SEARCH and SORT absent any negotiation using the COMPARATOR by SEARCH and SORT absent any negotiation using the COMPARATOR
command. The term "active comparator" refers to the comparator command. The term "active comparator" refers to the comparator
which will be used within a session e.g. by SEARCH and SORT. The which will be used within a session e.g. by SEARCH and SORT. The
COMPARATOR command is used to change the active comparator. COMPARATOR command is used to change the active comparator.
Internet-draft February 2006 Internet-draft November 2006
The active comparator applies to the following SEARCH keys: "BCC", The active comparator applies to the following SEARCH keys: "BCC",
"BODY", "CC", "FROM", "SUBJECT", "TEXT", "TO" and "HEADER". If the "BODY", "CC", "FROM", "SUBJECT", "TEXT", "TO" and "HEADER". If the
server also advertises the "SORT" extension, then the active server also advertises the "SORT" extension, then the active
comparator applies to the following SORT keys: "CC", "FROM", comparator applies to the following SORT keys: "CC", "FROM",
"SUBJECT" and "TO". If the server advertises the "SUBJECT" and "TO". If the server advertises THREAD=ORDEREDSUBJECT,
THREAD=ORDEREDSUBJECT, then the active comparator applies to the then the active comparator applies to the ORDEREDSUBJECT threading
ORDEREDSUBJECT threading algorithm. Future extensions may choose to algorithm. If the server advertises THREAD=REFERENCES, then the
active comparator applies to the subject field comparisons done by
REFERENCES threading algorithm. Future extensions may choose to
apply the active comparator to their SEARCH keys. apply the active comparator to their SEARCH keys.
For SORT and THREAD, the pre-processing necessary to extract the For SORT and THREAD, the pre-processing necessary to extract the
base subject text from a Subject header occurs prior to the base subject text from a Subject header occurs prior to the
application of a comparator. application of a comparator.
4.1 COMPARATOR Extension Requirements 4.1 COMPARATOR Extension Requirements
IMAP servers that support this extension MUST list the keyword IMAP servers that support this extension MUST list the keyword
COMPARATOR in their CAPABILITY data once IMAP enters authenticated COMPARATOR in their CAPABILITY data once IMAP enters authenticated
state, and MAY list that keyword in other states. state, and MAY list that keyword in other states.
A server that advertises this extension MUST implement the en;ascii- A server that advertises this extension MUST implement the i;ascii-
casemap and i;octet comparators, as defined in [8]. A server casemap and i;octet comparators, as defined in [RFCxxxx]. A server
intended to be deployed globally MUST implement the intended to be deployed globally MUST implement the i;basic
i;basic;uca=3.1.1;uv=3.2 comparator. comparator, as defined in [BASIC].
A server that advertises this extension MUST use a registered case- A server that advertises this extension SHOULD use i;ascii-casemap
insensitive comparator which supports the substring matching as the default comparator. The selection of the default comparator
function as the default comparator. If the server also advertises MAY be adjustable by the server administrator, and MAY be sensitive
the SORT or THREAD=ORDEREDSUBJECT extensions, then the default to the current user. Once the IMAP connection enters authenticated
comparator MUST also support the ordering function. The selection state, the default comparator MUST remain static for the remainder
of the default comparator MAY be adjustable by the server of that connection.
administrator, and MAY be sensitive to the current user. Once the
IMAP connection enters authenticated state, the default comparator
MUST remain static for the remainder of that connection.
A server that advertises this extension MUST support UTF-8 as a A server that advertises this extension MUST support UTF-8 as a
SEARCH charset. SEARCH charset.
The COMPARATOR command is valid in authenticated and selected The COMPARATOR command is valid in authenticated and selected
states. states.
Internet-draft February 2006 4.2 Comparators and Character Encodings
4.2 Comparators and Charsets When SEARCH, SORT, THREAD or another command needs to perform
collation operations on messages (or on the command's arguments),
the server MUST remove MIME encoding (see [RFC2047] for headers and
[RFC2045] for bodyparts) and convert character encodings compatibly
before doing the collation operation.
For SEARCH, SORT and THREAD operations that apply to message Internet-draft November 2006
headers, the server is responsible for removing the MIME header
encoding [10] and converting the text of any known charsets to UTF-8
prior to applying the comparator algorithm. Unknown charsets should
never match when using the SEARCH command, and should sort together
with invalid comparator input for the SORT and THREAD commands.
When message text is in a known charset other than UTF-8, the server Strings encoded using unknown character encodings should never match
is responsible for converting that text to UTF-8 prior to applying when using the SEARCH command, and should sort together with invalid
the comparator. When message text is in an unknown charset, then input for the SORT and THREAD commands.
the text should be skipped by the SEARCH command unless the
comparator is i;octet.
4.3 COMPARATOR Command 4.3 COMPARATOR Command
Arguments: Optional comparator order arguments. Arguments: Optional comparator order arguments.
Response: A possible COMPARATOR response (see Section 4.4). Response: A possible COMPARATOR response (see Section 4.4).
Result: OK - Command completed Result: OK - Command completed
NO - No matching comparator found NO - No matching comparator found
BAD - arguments invalid BAD - arguments invalid
skipping to change at page 9, line 42 skipping to change at page 9, line 31
The COMPARATOR command is used to determine or change the active The COMPARATOR command is used to determine or change the active
comparator. When issued with no arguments, it results in a comparator. When issued with no arguments, it results in a
COMPARATOR response indicating the currently active comparator. COMPARATOR response indicating the currently active comparator.
When issued with one or more comparator order argument, it will When issued with one or more comparator order argument, it will
change the active comparator if any comparator matches any argument. change the active comparator if any comparator matches any argument.
The COMPARATOR response will list other matching comparators if more The COMPARATOR response will list other matching comparators if more
than one matches the specified patterns. than one matches the specified patterns.
The argument "*" refers to the server's default comparator. The argument "*" refers to the server's default comparator.
Otherwise each argument is an comparator specification as defined in Otherwise each argument is an comparator specification as defined in
the Internet Application Protocol Comparator Registry [8]. the Internet Application Protocol Comparator Registry [RFCxxxx].
< The client requests activating a Czech comparator if possible, < The client requests activating a Czech comparator if possible,
or else a generic international comparator which it considers or else a generic international comparator which it considers
suitable for Czech. The server picks the first supported suitable for Czech. The server picks the first supported
comparator. > comparator. >
C: A001 COMPARATOR cz;* i;basic* C: A001 COMPARATOR cz;* i;basic*
S: * COMPARATOR i;basic;uca=3.1.1;uv=3.2 S: * COMPARATOR i;basic;uca=3.1.1;uv=3.2
S: A001 OK Will use i;basic;uca=3.1.1;uv=3.2 for collation S: A001 OK Will use i;basic;uca=3.1.1;uv=3.2 for collation
Internet-draft February 2006
< The client requests pure octet matching, then does a search < The client requests pure octet matching, then does a search
for potential GIF files, then switches back to its usual for potential GIF files, then switches back to its usual
comparator. > comparator. Note that this may not work on all IMAP servers,
see RFC 3501, page 50, second paragraph. >
C: B123 COMPARATOR i;octet C: B123 COMPARATOR i;octet
S: * COMPARATOR i;octet S: * COMPARATOR i;octet
S: B123 OK S: B123 OK
C: B124 SEARCH OR BODY GIF87A BODY GIF89A C: B124 SEARCH OR BODY GIF87A BODY GIF89A
S: * SEARCH 42 69 S: * SEARCH 42 69
S: B124 OK S: B124 OK
Internet-draft November 2006
C: B125 COMPARATOR cz;* i;basic* C: B125 COMPARATOR cz;* i;basic*
S: * COMPARATOR i;basic;uca=3.1.1;uv=3.2 S: * COMPARATOR i;basic;uca=3.1.1;uv=3.2
S: B125 OK S: B125 OK.
4.4 COMPARATOR Response 4.4 COMPARATOR Response
Contents: The active comparator. Contents: The active comparator.
An optional list of available matching comparators An optional list of available matching comparators
The COMPARATOR response occurs as a result of a COMPARATOR command. The COMPARATOR response occurs as a result of a COMPARATOR command.
The first argument in the comparator response is the name of the The first argument in the comparator response is the name of the
active comparator. The second argument is a list of comparators active comparator. The second argument is a list of comparators
which matched any of the arguments to the COMPARATOR command and is which matched any of the arguments to the COMPARATOR command and is
present only if more than one match is found. present only if more than one match is found.
4.5 Formal Syntax 4.5 Formal Syntax
The following syntax specification inherits ABNF [2] rules from The following syntax specification inherits ABNF [RFC4234] rules
IMAP4rev1 [6], and Internet Application Protocol Comparator Registry from IMAP4rev1 [RFC3501], and Internet Application Protocol
[8]. Comparator Registry [RFCxxxx].
command-auth =/ comparator-cmd command-auth =/ comparator-cmd
resp-text-code =/ "BADCOMPARATOR" / "BADMATCH" resp-text-code =/ "BADCOMPARATOR" / "BADMATCH"
comparator-cmd = "COMPARATOR" *(SP comp-order-quoted) comparator-cmd = "COMPARATOR" *(SP comp-order-quoted)
comparator-data = "COMPARATOR" SP comp-sel-quoted [SP "(" comparator-data = "COMPARATOR" SP comp-sel-quoted [SP "("
comp-name-quoted *(SP comp-name-quoted) ")"] comp-name-quoted *(SP comp-name-quoted) ")"]
comp-name-quoted = astring comp-name-quoted = astring
; Once any literal wrapper or quoting is removed, ; Once any literal wrapper or quoting is removed, this
; this follows the comparator-name rule ; follows the collation-name rule from [RFCxxxx]
Internet-draft February 2006
comp-order-quoted = astring comp-order-quoted = astring
; Once any literal wrapper or quoting is removed, ; Once any literal wrapper or quoting is removed, this
; this follows the comparator-order rule ; follows the collation-order rule from [RFCxxxx]
comp-sel-quoted = astring comp-sel-quoted = astring
; Once any literal wrapper or quoting is removed, ; Once any literal wrapper or quoting is removed, this
; this follows the comparator-sel rule ; follows the collation-sel rule from [RFCxxxx]
Internet-draft November 2006
5. Other IMAP Internationalization Issues 5. Other IMAP Internationalization Issues
The following sections provide an overview of various other IMAP The following sections provide an overview of various other IMAP
internationalization issues. These issues are not resolved by this internationalization issues. These issues are not resolved by this
specification, but could be resolved by future standards work. specification, but could be resolved by other standards work, such
as that being done by the EAI group (see [IMAP-EAI]).
5.1 Unicode Userids and Passwords 5.1 Unicode Userids and Passwords
IMAP4rev1 presently restricts the userid and password fields of the IMAP4rev1 presently restricts the userid and password fields of the
LOGIN command to US-ASCII. The "userid" and "password" fields of the LOGIN command to US-ASCII. The "userid" and "password" fields of the
IMAP LOGIN command are restricted to US-ASCII only until a future IMAP LOGIN command are restricted to US-ASCII only until a future
standards track RFC states otherwise. Servers are encouraged to standards track RFC states otherwise. Servers are encouraged to
validate both fields to make sure they conform to the formal syntax validate both fields to make sure they conform to the formal syntax
of UTF-8 and to reject the LOGIN command if that syntax is violated. of UTF-8 and to reject the LOGIN command if that syntax is violated.
Servers MAY reject the use of any 8-bit in the "userid" or Servers MAY reject the use of any 8-bit in the "userid" or
"password" field. "password" field.
When AUTHENTICATE is used, some servers may support userids and When AUTHENTICATE is used, some servers may support userids and
passwords in Unicode [13]. However, such userids cannot be used as passwords in Unicode [RFC3490] since SASL (see [RFC4422]) allows
email addresses, and at present also seem to be incompatible with that. However, such userids cannot be used as email addresses.
the current latest ACL drafts. Unless the ACL drafts resolve this,
server authors are cautioned against supporting ACL and unicode
userids simultaneously.
5.2 UTF-8 Mailbox Names 5.2 UTF-8 Mailbox Names
The modified UTF-7 mailbox naming convention described in section The modified UTF-7 mailbox naming convention described in section
5.1.3 of RFC 3501 is best viewed as an transition from the status 5.1.3 of RFC 3501 is best viewed as an transition from the status
quo in 1996 when modified UTF-7 was first specified. At that time, quo in 1996 when modified UTF-7 was first specified. At that time,
there was widespread unofficial use of local character sets such as there was widespread unofficial use of local character sets such as
ISO-8859-1 and Shift-JIS for non-ASCII mailbox names, with resultant ISO-8859-1 and Shift-JIS for non-ASCII mailbox names, with resultant
non-interoperability. non-interoperability.
The requirements in section 5.1 of RFC 3501 are very important if The requirements in section 5.1 of RFC 3501 are very important if
we're ever going to be able to deploy UTF-8 mailbox names. Servers we're ever going to be able to deploy UTF-8 mailbox names. Servers
are encourated to enforce them. are encouraged to enforce them.
Internet-draft February 2006
5.3 UTF-8 Domains, Addresses and Mail Headers 5.3 UTF-8 Domains, Addresses and Mail Headers
There is now an IETF standard for Internationalizing Domain Names in There is now an IETF standard for Internationalizing Domain Names in
Applications [13]. While IMAP clients are free to support this Applications [RFC3490]. While IMAP clients are free to support this
standard, an argument can be made that it would be helpful to simple standard, an argument can be made that it would be helpful to simple
clients if the IMAP server could perform this conversion (the same clients if the IMAP server could perform this conversion (the same
argument would apply to MIME header encoding [10]). However, it argument would apply to MIME header encoding [RFC2047]). However,
would be unwise to move forward with such work until the work in it would be unwise to move forward with such work until the work in
progress to define the format of international email addresses is progress to define the format of international email addresses is
complete. complete.
Internet-draft November 2006
6. IANA Considerations 6. IANA Considerations
When this is published as an RFC, the IMAP extensions LANGUAGE and The IANA is requested to add LANGUAGE and COMPARATOR to the IMAP
COMPARATOR are registered. Extensions registry.
7. Security Considerations 7. Security Considerations
The LANGUAGE extension makes a new command available in "Not The LANGUAGE extension makes a new command available in "Not
Authenticated" state in IMAP. Some IMAP implementations run with Authenticated" state in IMAP. Some IMAP implementations run with
root privilege when the server is in "Not Authenticated" state and root privilege when the server is in "Not Authenticated" state and
do not revoke that privilege until after authentication is complete. do not revoke that privilege until after authentication is complete.
Such implementations are particularly vulnerable to buffer overflow Such implementations are particularly vulnerable to buffer overflow
security errors at this stage and need to implement parsing of this security errors at this stage and need to implement parsing of this
command with extra care. command with extra care.
A LANGUAGE command issued prior to activation of a security layer is A LANGUAGE command issued prior to activation of a security layer is
subject to an active attack which suppresses or modifies the subject to an active attack which suppresses or modifies the
negotiation and thus makes STARTTLS or authentication error messages negotiation and thus makes STARTTLS or authentication error messages
more difficult to interpret. This is not a new attack as the error more difficult to interpret. This is not a new attack as the error
messages themselves are subject to active attack. Clients MUST re- messages themselves are subject to active attack. Clients MUST re-
issue the LANGUAGE command once a security layer is active, so this issue the LANGUAGE command once a security layer is active, so this
does not impact subsequent protocol operations. does not impact subsequent protocol operations.
Both the LANGUAGE and COMPARATOR extensions use the UTF-8 charset, Both the LANGUAGE and COMPARATOR extensions use the UTF-8 charset,
thus the security considerations for UTF-8 [7] are relevent. thus the security considerations for UTF-8 [RFC3629] are relevent.
However, neither uses UTF-8 for identifiers so the most serious However, neither uses UTF-8 for identifiers so the most serious
concerns do not apply. concerns do not apply.
Internet-draft February 2006
8. Acknowledgements 8. Acknowledgements
The LANGUAGE extension is based on a previous Internet draft by Mike The LANGUAGE extension is based on a previous Internet draft by Mike
Gahrns and Alexey Melnikov, a substantial portion of the text in Gahrns and Alexey Melnikov, a substantial portion of the text in
that section was written by them. Many people have participated in that section was written by them. Many people have participated in
discussions about an IMAP Language extension in the various fora of discussions about an IMAP Language extension in the various fora of
the IETF and Internet working groups, so any list of contributors is the IETF and Internet working groups, so any list of contributors is
bound to be incomplete. However, the authors would like to thank bound to be incomplete. However, the authors would like to thank
Andrew McCown for early work on the original proposal, John Myers Andrew McCown for early work on the original proposal, John Myers
for suggestions regarding the namespace issue, along with Jutta for suggestions regarding the namespace issue, along with Jutta
Degener, Mark Crispin, Mark Pustilnik, Larry Osterman and Martin Degener, Mark Crispin, Mark Pustilnik, Larry Osterman, Cyrus Daboo
Duerst for their many suggestions that have been incorporated into and Martin Duerst for their many suggestions that have been
this document. incorporated into this document.
Initial discussion of the COMPARATOR extension involved input from Initial discussion of the COMPARATOR extension involved input from
Mark Crispin and other participants of the IMAP Extensions WG. Mark Crispin and other participants of the IMAP Extensions WG.
Internet-draft November 2006
9. Relevant Standards for i18n IMAP Implementations 9. Relevant Standards for i18n IMAP Implementations
This is a non-normative list of standards to consider when This is a non-normative list of standards to consider when
implementing i18n aware IMAP software. implementing i18n aware IMAP software.
o The LANGUAGE and COMPARATOR extensions to IMAP (this o The LANGUAGE and COMPARATOR extensions to IMAP (this
specification). specification).
o The 8-bit rules for mailbox naming in section 5.1 of RFC 3501. o The 8-bit rules for mailbox naming in section 5.1 of RFC 3501.
o The Mailbox International Naming Convention in section 5.1.3 of o The Mailbox International Naming Convention in section 5.1.3 of
RFC 3501. RFC 3501.
o MIME [9] for message bodies. o MIME [RFC2045] for message bodies.
o MIME header encoding [10] for message headers. o MIME header encoding [RFC2047] for message headers.
o MIME Parameter Value and Encoded Word Extensions [11] for o The IETF EAI working group.
o MIME Parameter Value and Encoded Word Extensions [RFC2231] for
filenames. Quality IMAP server implementations will filenames. Quality IMAP server implementations will
automatically combine multipart parameters when generating the automatically combine multipart parameters when generating the
BODYSTRUCTURE. There is also some deployed non-standard use of BODYSTRUCTURE. There is also some deployed non-standard use of
MIME header encoding inside double-quotes for filenames. MIME header encoding inside double-quotes for filenames.
o IDNA [13] and punycode [14] for domain names (presently only o IDNA [RFC3490] and punycode [RFC3492] for domain names
relevant to IMAP clients). (presently only relevant to IMAP clients).
o The UTF-8 charset [7]. o The UTF-8 charset [RFC3629].
o The IETF policy on Character Sets and Languages [3]. o The IETF policy on Character Sets and Languages [RFC2277].
Internet-draft February 2006
Normative References Normative References
[1] Bradner, S., "Key words for use in RFCs to Indicate Requirement [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, March 1997.
[2] Crocker, D. and P. Overell, "Augmented BNF for Syntax [RFC2277] Alvestrand, "IETF Policy on Character Sets and
Specifications: ABNF", RFC 2234, November 1997. Languages", BCP 18, RFC 2277, January 1998.
[3] Alvestrand, H., "IETF Policy on Character Sets and Languages", [RFC2342] Gahrns, Newman, "IMAP4 Namespace", RFC 2342, May 1998.
BCP 18, RFC 2277, January 1998.
[4] Gahrns, M. and C. Newman, "IMAP4 Namespace", RFC 2342, May [RFC3501] Crispin, "INTERNET MESSAGE ACCESS PROTOCOL - VERSION
1998. 4rev1", RFC 3501, March 2003.
[5] Alvestrand, H., "Tags for the Identification of Languages", BCP [RFC3629] Yergeau, "UTF-8, a transformation format of ISO 10646",
47, RFC 3066, January 2001. STD 63, RFC 3629, November 2003.
[6] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION [RFC4234] Crocker, Overell, "Augmented BNF for Syntax
4rev1", RFC 3501, March 2003. Specifications: ABNF", RFC 4234, Brandenburg
Internetworking, Demon Internet Ltd, October 2005.
[7] Yergeau, F., "UTF-8, a transformation format of ISO 10646", STD [RFC4422] Melnikov, Zeilenga, "Simple Authentication and Security
63, RFC 3629, November 2003. Layer (SASL)", RFC 4422, June 2006.
[8] Newman, C., "Internet Application Protocol Comparator Internet-draft November 2006
Registry", draft-newman-i18n-comparator-05 (work in progress),
May 2005. [RFC4646] Philips, Davis, "Tags for Identifying Languages", BCP 47,
RFC 4646, September 2006.
[RFC4647] Philips, Davis, "Matching of Language Tags", BCP 47, RFC
4647, September 2006.
[RFCxxxx] Newman, Duerst, Gulbrandsen, "Internet Application
Protocol Comparator Registry", RFC-draft-newman-i18n-
comparator, September 2006
Informative References Informative References
[9] Freed, N. and N. Borenstein, "Multipurpose Internet Mail [RFC2045] Freed, Borenstein, "Multipurpose Internet Mail Extensions
Extensions (MIME) Part One: Format of Internet Message Bodies", (MIME) Part One: Format of Internet Message Bodies", RFC
RFC 2045, November 1996. 2045, November 1996.
[10] Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part [RFC2047] Moore, "MIME (Multipurpose Internet Mail Extensions) Part
Three: Message Header Extensions for Non-ASCII Text", RFC 2047, Three: Message Header Extensions for Non-ASCII Text", RFC
November 1996. 2047, November 1996.
[11] Freed, N. and K. Moore, "MIME Parameter Value and Encoded Word [RFC2231] Freed, Moore, "MIME Parameter Value and Encoded Word
Extensions: Character Sets, Languages, and Continuations", RFC Extensions: Character Sets, Languages, and
2231, November 1997. Continuations", RFC 2231, November 1997.
[12] Hoffman, P. and M. Blanchet, "Preparation of Internationalized [RFC3490] Faltstrom, Hoffman, Costello, "Internationalizing Domain
Strings ("stringprep")", RFC 3454, December 2002. Names in Applications (IDNA)", RFC 3490, March 2003.
[13] Faltstrom, P., Hoffman, P. and A. Costello, "Internationalizing [RFC3492] Costello, "Punycode: A Bootstring encoding of Unicode for
Domain Names in Applications (IDNA)", RFC 3490, March 2003. Internationalized Domain Names in Applications (IDNA)",
RFC 3492, March 2003.
Internet-draft February 2006 [SORT] Crispin, M. and K. Murchison, "INTERNET MESSAGE ACCESS
PROTOCOL - SORT AND THREAD EXTENSION", draft-ietf-
imapext-sort-17 (work in progress), May 2004.
[14] Costello, A., "Punycode: A Bootstring encoding of Unicode for [METADATA] Daboo, C., "IMAP METADATA Extension", draft-daboo-imap-
Internationalized Domain Names in Applications (IDNA)", RFC annotatemore-10 (work in progress), November 2006.
3492, March 2003.
[15] Crispin, M. and K. Murchison, "INTERNET MESSAGE ACCESS PROTOCOL [BASIC] Newman, Duerst, Gulbrandsen, "i;basic - Registration of
- SORT AND THREAD EXTENSION", draft-ietf-imapext-sort-17 (work the Unicode Collation Algorithm (UCA)", draft-
in progress), May 2004. gulbrandsen-collation-basic (work in progress), November
2006.
[16] Daboo, C., "IMAP ANNOTATEMORE Extension", draft-daboo-imap- [IMAP-EAI] Resnick, Newman, ""IMAP Support for UTF-8", draft-ietf-
annotatemore-07 (work in progress), February 2005. iea-imap-utf8 (work in progress), May 2006.
Internet-draft November 2006
Authors' Addresses Authors' Addresses
Chris Newman Chris Newman
Sun Microsystems Sun Microsystems
1050 Lakes Drive 3401 Centrelake Dr., Suite 410
West Covina, CA 91790 Ontario, CA 91761
US US
Email: chris.newman@sun.com Email: chris.newman@sun.com
Arnt Gulbrandsen Arnt Gulbrandsen
Oryx Mail Systems GmbH Oryx Mail Systems GmbH
Schweppermannstr. 8 Schweppermannstr. 8
D-81781 Muenchen D-81781 Muenchen
Germany Germany
Email: arnt@oryx.com Email: arnt@oryx.com
Phone: +49 89 4502 9757
Fax: +49 89 4502 9758 Fax: +49 89 4502 9758
Internet-draft February 2006 Internet-draft November 2006
Intellectual Property Statement Intellectual Property Statement
The IETF takes no position regarding the validity or scope of any The IETF takes no position regarding the validity or scope of any
Intellectual Property Rights or other rights that might be claimed Intellectual Property Rights or other rights that might be claimed
to pertain to the implementation or use of the technology described to pertain to the implementation or use of the technology described
in this document or the extent to which any license under such in this document or the extent to which any license under such
rights might or might not be available; nor does it represent that rights might or might not be available; nor does it represent that
it has made any independent effort to identify any such rights. it has made any independent effort to identify any such rights.
Information on the procedures with respect to rights in RFC Information on the procedures with respect to rights in RFC
 End of changes. 99 change blocks. 
209 lines changed or deleted 220 lines changed or added

This html diff was produced by rfcdiff 1.33. The latest version is available from http://tools.ietf.org/tools/rfcdiff/