imapext-2007

view docs/draft/i18n.txt @ 0:ada5e610ab86

imap-2007e
author yuuji@gentei.org
date Mon, 14 Sep 2009 15:17:45 +0900
parents
children
line source
7 Network Working Group Chris Newman
8 Internet-Draft Sun Microsystems
9 Intended Status: Proposed Standard Arnt Gulbrandsen
10 Oryx Mail Systems GmhH
11 Alexey Melnikov
12 Isode Limited
13 February 1, 2008
15 Internet Message Access Protocol Internationalization
16 draft-ietf-imapext-i18n-15.txt
19 Status of this Memo
20 By submitting this Internet-Draft, each author represents that any
21 applicable patent or other IPR claims of which he or she is aware
22 have been or will be disclosed, and any of which he or she becomes
23 aware will be disclosed, in accordance with Section 6 of BCP 79.
25 Internet-Drafts are working documents of the Internet Engineering
26 Task Force (IETF), its areas, and its working groups. Note that
27 other groups may also distribute working documents as Internet-
28 Drafts.
30 Internet-Drafts are draft documents valid for a maximum of six
31 months and may be updated, replaced, or obsoleted by other documents
32 at any time. It is inappropriate to use Internet-Drafts as
33 reference material or to cite them other than as "work in progress".
35 The list of current Internet-Drafts can be accessed at
36 http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-
37 Draft Shadow Directories can be accessed at
38 http://www.ietf.org/shadow.html.
40 This Internet-Draft expires in August 2008.
43 Copyright Notice
45 Copyright (C) The IETF Trust (2008).
48 Abstract
50 Internet Message Access Protocol (IMAP) version 4rev1 has basic
51 support for non-ASCII characters in mailbox names and search
52 substrings. It also supports non-ASCII message headers and content
53 encoded as specified by Multipurpose Internet Mail Extensions
54 (MIME). This specification defines a collection of IMAP extensions
58 Newman & Co Expires August 2008 FF[Page 1]
64 Internet-draft February 2008
67 which improve international support including comparator negotiation
68 for search, sort and thread, language negotiation for international
69 error text, and translations for namespace prefixes.
72 Table of Contents
74 1. Conventions Used in this Document . . . . . . . . . . . . . . 2
75 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
76 3. LANGUAGE Extension . . . . . . . . . . . . . . . . . . . . . 3
77 3.1 LANGUAGE Extension Requirements . . . . . . . . . . . . . . . 3
78 3.2 LANGUAGE Command . . . . . . . . . . . . . . . . . . . . . . 4
79 3.3 LANGUAGE Response . . . . . . . . . . . . . . . . . . . . . . 6
80 3.4 TRANSLATION Extension to the NAMESPACE Response . . . . . . . 6
81 3.5 Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 6
82 4. I18NLEVEL=1 and I18NLEVEL=2 Extensions . . . . . . . . . . . 7
83 4.1 Introduction and Overview . . . . . . . . . . . . . . . . . . 8
84 4.2 Requirements common to both I18NLEVEL=1 and I18NLEVEL=2 . . .
85 4.3 I18NLEVEL=1 Extension Requirements . . . . . . . . . . . . . 8
86 4.4 I18NLEVEL=2 Extension Requirements . . . . . . . . . . . . . 8
87 4.5 Compatibility Notes
88 4.6 Comparators and Charsets . . . . . . . . . . . . . . . . . . 9
89 4.7 COMPARATOR Command . . . . . . . . . . . . . . . . . . . . . 9
90 4.8 COMPARATOR Response . . . . . . . . . . . . . . . . . . . . . 10
91 4.9 BADCOMPARATOR Response Code . . . . . . . . . . . . . . . . .
92 4.10 Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . 10
93 5. Other IMAP Internationalization Issues . . . . . . . . . . . 11
94 5.1 UTF-8 Userids and Passwords . . . . . . . . . . . . . . . . . 11
95 5.2 UTF-8 Mailbox Names . . . . . . . . . . . . . . . . . . . . . 11
96 5.3 UTF-8 Domains, Addresses and Mail Headers . . . . . . . . . . 11
97 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12
98 7. Security Considerations . . . . . . . . . . . . . . . . . . . 12
99 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 12
100 9. Relevant Standards for i18n IMAP Implementations . . . . . . 13
101 Normative References . . . . . . . . . . . . . . . . . . . . 13
102 Informative References . . . . . . . . . . . . . . . . . . . 14
103 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 15
104 Intellectual Property and Copyright Statements . . . . . . . 16
107 Conventions Used in This Document
109 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
110 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
111 document are to be interpreted as described in [RFC2119].
113 The formal syntax use the Augmented Backus-Naur Form (ABNF)
114 [RFC4234] notation including the core rules defined in Appendix A.
118 Newman & Co Expires August 2008 FF[Page 2]
124 Internet-draft February 2008
127 The UTF8-related productions are defined in [RFC3629].
129 In examples, "C:" and "S:" indicate lines sent by the client and
130 server respectively. If a single "C:" or "S:" label applies to
131 multiple lines, then the line breaks between those lines are for
132 editorial clarity only and are not part of the actual protocol
133 exchange.
136 2. Introduction
138 This specification defines two IMAP4rev1 [RFC3501] extensions to
139 enhance international support. These extensions can be advertised
140 and implemented separately.
142 The LANGUAGE extension allows the client to request a suitable
143 language for protocol error messages and in combination with the
144 NAMESPACE extension [RFC2342] enables namespace translations.
146 The I18NLEVEL=2 extension allows the client to request a suitable
147 collation which will modify the behavior of the base specification's
148 SEARCH command as well as the SORT and THREAD extensions [SORT].
149 This leverages the collation registry [RFC4790].
152 3. LANGUAGE Extension
154 IMAP allows server responses to include human-readable text that in
155 many cases needs to be presented to the user. But that text is
156 limited to US-ASCII by the IMAP specification [RFC3501] in order to
157 preserve backwards compatibility with deployed IMAP implementations.
158 This section specifies a way for an IMAP client to negotiate which
159 language the server should use when sending human-readable text.
161 The LANGUAGE extension only provides a mechanism for altering fixed
162 server strings such as response text and NAMESPACE folder names.
163 Assigning localized language aliases to shared mailboxes would be
164 done with a separate mechanism such as the proposed METADATA
165 extension (see [METADATA]).
168 3.1 LANGUAGE Extension Requirements
170 IMAP servers that support this extension MUST list the keyword
171 LANGUAGE in their CAPABILITY response as well as in the greeting
172 CAPABILITY data.
174 A server that advertises this extension MUST use the language "i-
178 Newman & Co Expires August 2008 FF[Page 3]
184 Internet-draft February 2008
187 default" as described in [RFC2277] as its default language until
188 another supported language is negotiated by the client. A server
189 MUST include "i-default" as one of its supported languages.
191 Clients and servers that support this extension MUST also support
192 the NAMESPACE extension [RFC2342].
194 The LANGUAGE command is valid in all states. Clients are urged to
195 issue LANGUAGE before authentication, since some servers send
196 valuable user information as part of authentication (e.g. "password
197 is correct, but expired"). If a security layer (such as SASL or
198 TLS) is subsequently negotiated by the client, it MUST re-issue the
199 LANGUAGE command in order to make sure that no previous active
200 attack (if any) on LANGUAGE negotiation has effect on subsequent
201 error messages. (See Section 7 for a more detailed explanation of
202 the attack.)
206 3.2 LANGUAGE Command
208 Arguments: Optional language range arguments.
210 Response: A possible LANGUAGE response (see section 3.3).
211 A possible NAMESPACE response (see section 3.4).
213 Result: OK - Command completed
214 NO - Could not complete command
215 BAD - arguments invalid
217 The LANGUAGE command requests that human-readable text emitted by
218 the server be localized to a language matching one of the language
219 range argument as described by section 2 of [RFC4647].
221 If the command succeeds, the server will return human-readable
222 responses in the first supported language specified. These
223 responses will be in UTF-8 [RFC3629]. The server MUST send a
224 LANGUAGE response specifying the language used, and the change takes
225 effect immediately after the LANGUAGE response.
227 If the command fails, the server continues to return human-readable
228 responses in the language it was previously using.
230 The special "default" language range argument indicates a request to
231 use a language designated as preferred by the server administrator.
232 The preferred language MAY vary based on the currently active user.
234 If a language range does not match a known language tag exactly but
238 Newman & Co Expires August 2008 FF[Page 4]
244 Internet-draft February 2008
247 does match a language by the rules of [RFC4647], the server MUST
248 send an untagged LANGUAGE response indicating the language selected.
250 If there aren't any arguments, the server SHOULD send an untagged
251 LANGUAGE response listing the languages it supports. If the server
252 is unable to enumerate the list of languages it supports it MAY
253 return a tagged NO response to the enumeration request.
255 < The server defaults to using English i-default responses until
256 the user explicitly changes the language. >
258 C: A001 LOGIN KAREN PASSWORD
259 S: A001 OK LOGIN completed
261 < Client requested MUL language, which no server supports. >
263 C: A002 LANGUAGE MUL
264 S: A002 NO Unsupported language MUL
266 < A LANGUAGE command with no arguments is a request to enumerate
267 the list of languages the server supports. >
269 C: A003 LANGUAGE
270 S: * LANGUAGE (EN DE IT i-default)
271 S: A003 OK Supported languages have been enumerated
273 C: B001 LANGUAGE
274 S: B001 NO Server is unable to enumerate supported languages
276 < Once the client changes the language, all responses will be in
277 that language starting after the LANGUAGE response. Note that
278 this includes the NAMESPACE response. Because RFCs are in US-
279 ASCII, this document uses an ASCII transcription rather than
280 UTF-8 text, e.g. ue in the word "ausgefuehrt" >
282 C: C001 LANGUAGE DE
283 S: * LANGUAGE (DE)
284 S: * NAMESPACE (("" "/")) (("Other Users/" "/" "TRANSLATION"
285 ("Andere Ben&APw-tzer/"))) (("Public Folders/" "/"
286 "TRANSLATION" ("Gemeinsame Postf&AM8-cher/")))
287 S: C001 OK Sprachwechsel durch LANGUAGE-Befehl ausgefuehrt
289 < If a server does not support the requested primary language,
290 responses will continue to be returned in the current language
291 the server is using. >
293 C: D001 LANGUAGE FR
294 S: D001 NO Diese Sprache ist nicht unterstuetzt
298 Newman & Co Expires August 2008 FF[Page 5]
304 Internet-draft February 2008
307 C: D002 LANGUAGE DE-IT
308 S: * LANGUAGE (DE-IT)
309 S: * NAMESPACE (("" "/"))(("Other Users/" "/" "TRANSLATION"
310 ("Andere Ben&APw-tzer/"))) (("Public Folders/" "/"
311 "TRANSLATION" ("Gemeinsame Postf&AM8-cher/")))
312 S: D002 OK Sprachwechsel durch LANGUAGE-Befehl ausgefuehrt
313 C: D003 LANGUAGE "default"
314 S: * LANGUAGE (DE)
315 S: D003 OK Sprachwechsel durch LANGUAGE-Befehl ausgefuehrt
317 < Server does not speak French, but does speak English. User
318 speaks Canadian French and Canadian English. >
320 C: E001 LANGUAGE FR-CA EN-CA
321 S: * LANGUAGE (EN)
322 S: E001 OK Now speaking English
326 3.3 LANGUAGE Response
328 Contents: A list of one or more language tags.
330 The LANGUAGE response occurs as a result of a LANGUAGE command. A
331 LANGUAGE response with a list containing a single language tag
332 indicates that the server is now using that language. A LANGUAGE
333 response with a list containing multiple language tags indicates the
334 server is communicating a list of available languages to the client,
335 and no change in the active language has been made.
338 3.4 TRANSLATION Extension to the NAMESPACE Response
340 If localized representations of the namespace prefixes are available
341 in the selected language, the server SHOULD include these in the
342 TRANSLATION extension to the NAMESPACE response.
344 The TRANSLATION extension to the NAMESPACE response returns a single
345 string, containing the modified UTF-7 [RFC3501] encoded translation
346 of the namespace prefix. It is the responsibility of the client to
347 convert between the namespace prefix and the translation of the
348 namespace prefix when presenting mailbox names to the user.
350 In this example a server supports the IMAP4 NAMESPACE command. It
351 uses no prefix to the user's Personal Namespace, a prefix of "Other
352 Users" to its Other Users' Namespace and a prefix of "Public
353 Folders" to its only Shared Namespace. Since a client will often
354 display these prefixes to the user, the server includes a
358 Newman & Co Expires August 2008 FF[Page 6]
364 Internet-draft February 2008
367 translation of them that can be presented to the user.
369 C: A001 LANGUAGE DE-IT
370 S: * NAMESPACE (("" "/")) (("Other Users/" "/" "TRANSLATION"
371 ("Andere Ben&APw-tzer/"))) (("Public Folders/" "/"
372 "TRANSLATION" ("Gemeinsame Postf&AM8-cher/")))
373 S: A001 OK LANGUAGE-Befehl ausgefuehrt
376 3.5 Formal Syntax
378 The following syntax specification inherits ABNF [RFC4234] rules
379 from IMAP4rev1 [RFC3501], IMAP4 Namespace [RFC2342], Tags for the
380 Identifying Languages [RFC4646], UTF-8 [RFC3629] and Collected
381 Extensions to IMAP4 ABNF [RFC4466].
383 command-any =/ language-cmd
384 ; LANGUAGE command is valid in all states
386 language-cmd = "LANGUAGE" *(SP lang-range-quoted)
388 response-payload =/ language-data
390 language-data = "LANGUAGE" SP "(" lang-tag-quoted *(SP
391 lang-tag-quoted) ")"
393 namespace-trans = SP DQUOTE "TRANSLATION" DQUOTE SP "(" string ")"
394 ; the string is encoded in Modified UTF-7.
395 ; this is a subset of the syntax permitted by
396 ; the Namespace-Response-Extension rule in [RFC4466]
398 lang-range-quoted = astring
399 ; Once any literal wrapper or quoting is removed, this
400 ; follows the language-range rule in [RFC4647]
402 lang-tag-quoted = astring
403 ; Once any literal wrapper or quoting is removed, this follows
404 ; the Language-Tag rule in [RFC4646]
406 resp-text = ["[" resp-text-code "]" SP ] UTF8-TEXT-CHAR
407 *(UTF8-TEXT-CHAR / "[")
408 ; After the server is changed to a language other than
409 ; i-default, this resp-text rule replaces the resp-text
410 ; rule from [RFC3501].
412 UTF8-TEXT-CHAR = %x20-5A / %x5C-7E / UTF8-2 / UTF8-3 / UTF8-4
413 ; UTF-8 excluding 7-bit control characters and "["
418 Newman & Co Expires August 2008 FF[Page 7]
424 Internet-draft February 2008
427 4. I18NLEVEL=1 and I18NLEVEL=2 Extensions
430 4.1 Introduction and Overview
432 IMAP4rev1 [RFC3501] includes the SEARCH command which can be used to
433 locate messages matching criteria including human-readable text.
434 The SORT extension [SORT] to IMAP allows the client to ask the
435 server to determine the order of messages based on criteria
436 including human-readable text. These mechanisms require the ability
437 to support non-English search and sort functions.
439 Section 4 defines two IMAP extensions for internationalizing IMAP
440 SEARCH, SORT and THREAD [SORT] using the comparator framework
441 [RFC4790].
443 The I18NLEVEL=1 extension updates SEARCH/SORT/THREAD to use
444 i;unicode-casemap comparator, as defined in [UCM]. See Sections 4.2
445 and 4.3 for more details.
447 The I18NLEVEL=2 extension is a superset of the I18NLEVEL=1
448 extension. It adds to I18NLEVEL=1 extension the ability to determine
449 the active comparator (see definition below) and negotiate use of
450 comparators using the COMPARATOR command. It also adds the
451 COMPARATOR response that indicates the active comparator and
452 possibly other available comparators. See Sections 4.2 and 4.4 for
453 more details.
456 4.2 Requirements common to both I18NLEVEL=1 and I18NLEVEL=2
458 The term "default comparator" refers to the comparator which is used
459 by SEARCH and SORT absent any negotiation using the COMPARATOR (see
460 Section 4.7) command. The term "active comparator" refers to the
461 comparator which will be used within a session e.g. by SEARCH and
462 SORT. The COMPARATOR command is used to change the active
463 comparator.
465 The active comparator applies to the following SEARCH keys: "BCC",
466 "BODY", "CC", "FROM", "SUBJECT", "TEXT", "TO" and "HEADER". If the
467 server also advertises the "SORT" extension, then the active
468 comparator applies to the following SORT keys: "CC", "FROM",
469 "SUBJECT" and "TO". If the server advertises THREAD=ORDEREDSUBJECT,
470 then the active comparator applies to the ORDEREDSUBJECT threading
471 algorithm. If the server advertises THREAD=REFERENCES, then the
472 active comparator applies to the subject field comparisons done by
473 REFERENCES threading algorithm. Future extensions may choose to
474 apply the active comparator to their SEARCH keys.
478 Newman & Co Expires August 2008 FF[Page 8]
484 Internet-draft February 2008
487 For SORT and THREAD, the pre-processing necessary to extract the
488 base subject text from a Subject header occurs prior to the
489 application of a comparator.
491 A server that advertises I18NLEVEL=1 or I18NLEVEL=2 extension MUST
492 implement the i;unicode-casemap comparator, as defined in [UCM].
494 A server that advertises I18NLEVEL=1 or I18NLEVEL=2 extension MUST
495 support UTF-8 as a SEARCH charset.
498 4.3 I18NLEVEL=1 Extension Requirements
500 An IMAP server that satisfies all requirements specified in sections
501 4.2 and 4.6 (and doesn't support/advertise any other I18NLEVEL=<n>
502 extension, where n > 1) MUST list the keyword I18NLEVEL=1 in its
503 CAPABILITY data once IMAP enters the authenticated state, and MAY
504 list that keyword in other states.
508 4.4 I18NLEVEL=2 Extension Requirements
510 IMAP server that satisfies all requirements specified in sections
511 4.2, 4.4, 4.6-4.10 (and doesn't support/advertise any other
512 I18NLEVEL=<n> extension, where n > 2) MUST list the keyword
513 I18NLEVEL=2 in its CAPABILITY data once IMAP enters the
514 authenticated state, and MAY list that keyword in other states.
516 A server that advertises this extension MUST implement the
517 i;unicode-casemap comparator, as defined in [UCM]. It MAY implement
518 other comparators from the IANA registry established by [RFC4790].
519 See also section 4.5 of this document.
521 A server that advertises this extension SHOULD use i;unicode-casemap
522 as the default comparator. (Note that i;unicode-casemap is the
523 default comparator for I18NLEVEL=1, but not necessarily the default
524 for I18NLEVEL=2.) The selection of the default comparator MAY be
525 adjustable by the server administrator, and MAY be sensitive to the
526 current user. Once the IMAP connection enters authenticated state,
527 the default comparator MUST remain static for the remainder of that
528 connection.
530 Note that since SEARCH uses the substring operation, IMAP servers
531 can only implement collations that offer the substring operation
532 (see [RFC4790 section 4.2.2). Since SORT uses ordering operation
533 (and by implication equality), IMAP servers which advertise the SORT
534 extension can only implement collations that offer all three
538 Newman & Co Expires August 2008 FF[Page 9]
544 Internet-draft February 2008
547 operations (see [RFC4790] sections 4.2.2-4).
549 If the active collation does not provide the operations needed by an
550 IMAP command, the server MUST respond with a tagged BAD.
553 4.5 Compatibility Notes
555 Several server implementations deployed prior to the publication of
556 this specification comply with I18NLEVEL=1 (see section 4.3), but do
557 not advertise that. Other legacy servers use the i;ascii-casemap
558 (see [RFC4790]) comparator.
560 There is no good way for a client to know which comparator that a
561 legacy server uses. If the client has to assume the worst, it may
562 end up doing expensive local operations to obtain i;unicode-casemap
563 comparisons even though the server implements it.
565 Legacy server implementations which comply with I18NLEVEL=1 should
566 be updated to advertise I18NLEVEL=1. All server implementations
567 should eventually be updated to comply with the I18NLEVEL=2
568 extension.
571 4.6 Comparators and Character Encodings
573 RFC 3501, section 6.4.4 says:
575 In all search keys that use strings, a message matches
576 the key if the string is a substring of the field. The
577 matching is case-insensitive.
579 When performing the SEARCH operation, the active comparator is
580 applied instead of the case-insensitive matching specified above.
582 An IMAP server which performs collation operations (e.g., as part of
583 commands such as SEARCH, SORT, THREAD) does so according to the
584 following procedure:
586 (a) MIME encoding (for example see [RFC2047] for headers and
587 [RFC2045] for body parts) MUST be removed in the texts being
588 collated.
590 If MIME encoding removal fails for a message (e.g., a body part
591 of the message has an unsupported Content-Transfer-Encoding,
592 uses characters not allowed by the Content-Transfer-Encoding,
593 etc.), the collation of this message is undefined by this
594 specification, and is handled in an implementation-dependent
598 Newman & Co Expires August 2008 FF[Page 10]
604 Internet-draft February 2008
607 manner.
609 (b) The decoded text from (a) MUST be converted to the charset
610 expected by the active comparator.
612 (c) For the substring operation:
613 If step (b) failed (e.g., the text is in an unknown charset,
614 contains a sequence which is not valid according in that
615 charset, etc.), the original decoded text from (a) (i.e.,
616 before the charset conversion attempt) is collated using the
617 i;octet comparator (see [RFC4790]).
619 If step (b) was successful, the converted text from (b) is
620 collated according to the active comparator.
623 For the ordering operation:
625 All strings that were successfully converted by step (b) are
626 separated from all strings that failed step (b). Strings in
627 each group are collated independently. All strings successfully
628 converted by step (b) are then validated by the active
629 comparator. Strings that pass validation are collated using the
630 active comparator. All strings that either fail step (b) or fail
631 the active collation's validity operation are collated (after
632 applying step (a)) using the i;octet comparator (see [RFC4790]).
633 The resulting sorted list is produced by appending all collated
634 "failed" strings after all strings collated using the active
635 comparator.
638 Example: The following example demonstrates ordering of 4
639 different strings using i;unicode-casemap [UCM] comparator.
640 Strings are represented using hexadecimal notation used by
641 ABNF [RFC4234].
643 (1) %xD0 %xC0 %xD0 %xBD %xD0 %xB4 %xD1 %x80 %xD0 %xB5
644 %xD0 %xB9 (labeled with charset=UTF-8)
645 (2) %xD1 %x81 %xD0 %x95 %xD0 %xA0 %xD0 %x93 %xD0 %x95
646 %xD0 %x99 (labeled with charset=UTF-8)
647 (3) %xD0 %x92 %xD0 %xB0 %xD1 %x81 %xD0 %xB8 %xD0 %xBB
648 %xD0 %xB8 %xFF %xB9 (labeled with charset=UTF-8)
649 (4) %xE1 %xCC %xC5 %xCB %xD3 %xC5 %xCA (labeled with
650 charset=KOI8-R)
652 Step (b) will convert string # 4 to the following
653 sequence of octets (in UTF-8):
658 Newman & Co Expires August 2008 FF[Page 11]
664 Internet-draft February 2008
667 %xD0 %x90 %xD0 %xBB %xD0 %xB5 %xD0 %xBA %xD1 %x81 %xD0
668 %xB5 %xD0 %xB9
670 and will reject strings (1) and (3), as they contain
671 octets not allowed in charset=UTF-8.
672 After that, using the i;unicode-casemap collation,
673 string (4) will collate before string (2). Using the
674 i;octet collation on the original strings, string (3)
675 will collate before string (1). So the final ordering
676 is as follows: (4) (2) (3) (1).
678 If the substring operation (e.g., IMAP SEARCH) of the active
679 comparator returns the "undefined" result (see section 4.2.3 of
680 [RFC4790]) for either the text specified in the SEARCH command or
681 the message text, then the operation is repeated on the result of
682 step (a) using the i;octet comparator.
684 The ordering operation (e.g., IMAP SORT and THREAD) SHOULD collate
685 the following together: strings encoded using unknown or invalid
686 character encodings, strings in unrecognized charsets, and invalid
687 input (as defined by the active collation).
691 4.7 COMPARATOR Command
693 Arguments: Optional comparator order arguments.
695 Response: A possible COMPARATOR response (see Section 4.8).
697 Result: OK - Command completed
698 NO - No matching comparator found
699 BAD - arguments invalid
701 The COMPARATOR command is valid in authenticated and selected
702 states.
704 The COMPARATOR command is used to determine or change the active
705 comparator. When issued with no arguments, it results in a
706 COMPARATOR response indicating the currently active comparator.
708 When issued with one or more comparator argument, it changes the
709 active comparator as directed. (If more than one installed
710 comparator is matched by an argument, the first argument wins.) The
711 COMPARATOR response lists all matching comparators if more than one
712 matches the specified patterns.
714 The argument "default" refers to the server's default comparator.
718 Newman & Co Expires August 2008 FF[Page 12]
724 Internet-draft February 2008
727 Otherwise each argument is an collation specification as defined in
728 the Internet Application Protocol Comparator Registry [RFC4790].
730 < The client requests activating a Czech comparator if possible,
731 or else a generic international comparator which it considers
732 suitable for Czech. The server picks the first supported
733 comparator. >
735 C: A001 COMPARATOR "cz;*" i;basic
736 S: * COMPARATOR i;basic
737 S: A001 OK Will use i;basic for collation
740 4.8 COMPARATOR Response
742 Contents: The active comparator.
743 An optional list of available matching comparators
745 The COMPARATOR response occurs as a result of a COMPARATOR command.
746 The first argument in the comparator response is the name of the
747 active comparator. The second argument is a list of comparators
748 which matched any of the arguments to the COMPARATOR command and is
749 present only if more than one match is found.
752 4.9 BADCOMPARATOR response code
754 This response code SHOULD be returned as a result of server failing
755 an IMAP command (returning NO), when the server knows that none of
756 the specified comparators match the requested comparator(s).
759 4.10 Formal Syntax
761 The following syntax specification inherits ABNF [RFC4234] rules
762 from IMAP4rev1 [RFC3501], and Internet Application Protocol
763 Comparator Registry [RFC4790].
765 command-auth =/ comparator-cmd
767 resp-text-code =/ "BADCOMPARATOR"
769 comparator-cmd = "COMPARATOR" *(SP comp-order-quoted)
771 response-payload =/ comparator-data
773 comparator-data = "COMPARATOR" SP comp-sel-quoted [SP "("
774 comp-id-quoted *(SP comp-id-quoted) ")"]
778 Newman & Co Expires August 2008 FF[Page 13]
784 Internet-draft February 2008
787 comp-id-quoted = astring
788 ; Once any literal wrapper or quoting is removed, this
789 ; follows the collation-id rule from [RFC4790]
791 comp-order-quoted = astring
792 ; Once any literal wrapper or quoting is removed, this
793 ; follows the collation-order rule from [RFC4790]
795 comp-sel-quoted = astring
796 ; Once any literal wrapper or quoting is removed, this
797 ; follows the collation-selected rule from [RFC4790]
800 5. Other IMAP Internationalization Issues
802 The following sections provide an overview of various other IMAP
803 internationalization issues. These issues are not resolved by this
804 specification, but could be resolved by other standards work, such
805 as that being done by the EAI group (see [IMAP-EAI]).
808 5.1 Unicode Userids and Passwords
810 IMAP4rev1 currently restricts the userid and password fields of the
811 LOGIN command to US-ASCII. The "userid" and "password" fields of the
812 IMAP LOGIN command are restricted to US-ASCII only until a future
813 standards track RFC states otherwise. Servers are encouraged to
814 validate both fields to make sure they conform to the formal syntax
815 of UTF-8 and to reject the LOGIN command if that syntax is violated.
816 Servers MAY reject the use of any 8-bit in the "userid" or
817 "password" field.
819 When AUTHENTICATE is used, some servers may support userids and
820 passwords in Unicode [RFC3490] since SASL (see [RFC4422]) allows
821 that. However, such userids cannot be used as part of email
822 addresses.
825 5.2 UTF-8 Mailbox Names
827 The modified UTF-7 mailbox naming convention described in section
828 5.1.3 of RFC 3501 is best viewed as an transition from the status
829 quo in 1996 when modified UTF-7 was first specified. At that time,
830 there was widespread unofficial use of local character sets such as
831 ISO-8859-1 and Shift-JIS for non-ASCII mailbox names, with resultant
832 non-interoperability.
834 The requirements in section 5.1 of RFC 3501 are very important if
838 Newman & Co Expires August 2008 FF[Page 14]
844 Internet-draft February 2008
847 we're ever going to be able to deploy UTF-8 mailbox names. Servers
848 are encouraged to enforce them.
851 5.3 UTF-8 Domains, Addresses and Mail Headers
853 There is now an IETF standard for Internationalizing Domain Names in
854 Applications [RFC3490]. While IMAP clients are free to support this
855 standard, an argument can be made that it would be helpful to simple
856 clients if the IMAP server could perform this conversion (the same
857 argument would apply to MIME header encoding [RFC2047]). However,
858 it would be unwise to move forward with such work until the work in
859 progress to define the format of international email addresses is
860 complete.
863 6. IANA Considerations
865 The IANA is requested to add LANGUAGE, I18NLEVEL=1 and I18NLEVEL=2
866 to the IMAP4 Capabilities Registry. [Note to IANA:
867 http://www.iana.org/assignments/imap4-capabilities]
870 7. Security Considerations
872 The LANGUAGE extension makes a new command available in "Not
873 Authenticated" state in IMAP. Some IMAP implementations run with
874 root privilege when the server is in "Not Authenticated" state and
875 do not revoke that privilege until after authentication is complete.
876 Such implementations are particularly vulnerable to buffer overflow
877 security errors at this stage and need to implement parsing of this
878 command with extra care.
880 A LANGUAGE command issued prior to activation of a security layer is
881 subject to an active attack which suppresses or modifies the
882 negotiation and thus makes STARTTLS or authentication error messages
883 more difficult to interpret. This is not a new attack as the error
884 messages themselves are subject to active attack. Clients MUST re-
885 issue the LANGUAGE command once a security layer is active, so this
886 does not impact subsequent protocol operations.
888 LANGUAGE, I18NLEVEL=1 and I18NLEVEL=2 extensions use the UTF-8
889 charset, thus the security considerations for UTF-8 [RFC3629] are
890 relevent. However, neither uses UTF-8 for identifiers so the most
891 serious concerns do not apply.
894 8. Acknowledgements
898 Newman & Co Expires August 2008 FF[Page 15]
904 Internet-draft February 2008
907 The LANGUAGE extension is based on a previous Internet draft by Mike
908 Gahrns, a substantial portion of the text in that section was
909 written by him. Many people have participated in discussions about
910 an IMAP Language extension in the various fora of the IETF and
911 Internet working groups, so any list of contributors is bound to be
912 incomplete. However, the authors would like to thank Andrew McCown
913 for early work on the original proposal, John Myers for suggestions
914 regarding the namespace issue, along with Jutta Degener, Mark
915 Crispin, Mark Pustilnik, Larry Osterman, Cyrus Daboo, Martin Duerst,
916 Timo Sirainen, Ben Campbell and Magnus Nystrom for their many
917 suggestions that have been incorporated into this document.
919 Initial discussion of the I18NLEVEL=2 extension involved input from
920 Mark Crispin and other participants of the IMAP Extensions WG.
923 9. Relevant Standards for i18n IMAP Implementations
925 This is a non-normative list of standards to consider when
926 implementing i18n aware IMAP software.
928 o The LANGUAGE and I18NLEVEL=2 extensions to IMAP (this
929 specification).
930 o The 8-bit rules for mailbox naming in section 5.1 of RFC 3501.
931 o The Mailbox International Naming Convention in section 5.1.3 of
932 RFC 3501.
933 o MIME [RFC2045] for message bodies.
934 o MIME header encoding [RFC2047] for message headers.
935 o The IETF EAI working group.
936 o MIME Parameter Value and Encoded Word Extensions [RFC2231] for
937 filenames. Quality IMAP server implementations will
938 automatically combine multipart parameters when generating the
939 BODYSTRUCTURE. There is also some deployed non-standard use of
940 MIME header encoding inside double-quotes for filenames.
941 o IDNA [RFC3490] and punycode [RFC3492] for domain names
942 (currently only relevant to IMAP clients).
943 o The UTF-8 charset [RFC3629].
944 o The IETF policy on Character Sets and Languages [RFC2277].
947 Normative References
949 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
950 Requirement Levels", BCP 14, RFC 2119, March 1997.
952 [RFC2277] Alvestrand, "IETF Policy on Character Sets and
953 Languages", BCP 18, RFC 2277, January 1998.
958 Newman & Co Expires August 2008 FF[Page 16]
964 Internet-draft February 2008
967 [RFC2342] Gahrns, Newman, "IMAP4 Namespace", RFC 2342, May 1998.
969 [RFC3501] Crispin, "INTERNET MESSAGE ACCESS PROTOCOL - VERSION
970 4rev1", RFC 3501, March 2003.
972 [RFC3629] Yergeau, "UTF-8, a transformation format of ISO 10646",
973 STD 63, RFC 3629, November 2003.
975 [RFC4234] Crocker, Overell, "Augmented BNF for Syntax
976 Specifications: ABNF", RFC 4234, Brandenburg
977 Internetworking, Demon Internet Ltd, October 2005.
979 [RFC4422] Melnikov, Zeilenga, "Simple Authentication and Security
980 Layer (SASL)", RFC 4422, June 2006.
982 [RFC4466] Melnikov, Daboo, "Collected Extensions to IMAP4 ABNF",
983 RFC 4466, Isode Ltd., April 2006.
985 [RFC4646] Philips, Davis, "Tags for Identifying Languages", BCP 47,
986 RFC 4646, September 2006.
988 [RFC4647] Philips, Davis, "Matching of Language Tags", BCP 47, RFC
989 4647, September 2006.
991 [RFC4790] Newman, Duerst, Gulbrandsen, "Internet Application
992 Protocol Comparator Registry", RFC 4790, February 2007.
994 [SORT] Crispin, M. and K. Murchison, "INTERNET MESSAGE ACCESS
995 PROTOCOL - SORT AND THREAD EXTENSION", draft-ietf-
996 imapext-sort-19 (work in progress), November 2006.
998 [UCM] Crispin, "i;unicode-casemap - Simple Unicode Collation
999 Algorithm", RFC 5051, October 2007.
1001 [RFC2045] Freed, Borenstein, "Multipurpose Internet Mail Extensions
1002 (MIME) Part One: Format of Internet Message Bodies", RFC
1003 2045, November 1996.
1005 [RFC2047] Moore, "MIME (Multipurpose Internet Mail Extensions) Part
1006 Three: Message Header Extensions for Non-ASCII Text", RFC
1007 2047, November 1996.
1010 Informative References
1013 [RFC2231] Freed, Moore, "MIME Parameter Value and Encoded Word
1014 Extensions: Character Sets, Languages, and
1018 Newman & Co Expires August 2008 FF[Page 17]
1024 Internet-draft February 2008
1027 Continuations", RFC 2231, November 1997.
1029 [RFC3490] Faltstrom, Hoffman, Costello, "Internationalizing Domain
1030 Names in Applications (IDNA)", RFC 3490, March 2003.
1032 [RFC3492] Costello, "Punycode: A Bootstring encoding of Unicode for
1033 Internationalized Domain Names in Applications (IDNA)",
1034 RFC 3492, March 2003.
1036 [METADATA] Daboo, C., "IMAP METADATA Extension", draft-daboo-imap-
1037 annotatemore-12 (work in progress), December 2007.
1039 [IMAP-EAI] Resnick, Newman, "IMAP Support for UTF-8", draft-ietf-
1040 eai-imap-utf8 (work in progress), May 2006.
1044 Authors' Addresses
1046 Chris Newman
1047 Sun Microsystems
1048 3401 Centrelake Dr., Suite 410
1049 Ontario, CA 91761
1050 US
1052 Email: chris.newman@sun.com
1055 Arnt Gulbrandsen
1056 Oryx Mail Systems GmbH
1057 Schweppermannstr. 8
1058 D-81671 Muenchen
1059 Germany
1061 Email: arnt@oryx.com
1063 Fax: +49 89 4502 9758
1066 Alexey Melnikov
1067 Isode Limited
1068 5 Castle Business Village, 36 Station Road,
1069 Hampton, Middlesex, TW12 2BX, UK
1071 Email: Alexey.Melnikov@isode.com
1078 Newman & Co Expires August 2008 FF[Page 18]
1084 Internet-draft February 2008
1087 Intellectual Property Statement
1089 The IETF takes no position regarding the validity or scope of any
1090 Intellectual Property Rights or other rights that might be claimed to
1091 pertain to the implementation or use of the technology described in
1092 this document or the extent to which any license under such rights
1093 might or might not be available; nor does it represent that it has
1094 made any independent effort to identify any such rights. Information
1095 on the procedures with respect to rights in RFC documents can be found
1096 in BCP 78 and BCP 79.
1098 Copies of IPR disclosures made to the IETF Secretariat and any
1099 assurances of licenses to be made available, or the result of an
1100 attempt made to obtain a general license or permission for the use of
1101 such proprietary rights by implementers or users of this specification
1102 can be obtained from the IETF on-line IPR repository at
1103 http://www.ietf.org/ipr.
1105 The IETF invites any interested party to bring to its attention any
1106 copyrights, patents or patent applications, or other proprietary
1107 rights that may cover technology that may be required to implement
1108 this standard. Please address the information to the IETF at
1109 ietf-ipr@ietf.org.
1112 Full Copyright Statement
1114 Copyright (C) The IETF Trust (2008). This document is subject to
1115 the rights, licenses and restrictions contained in BCP 78, and
1116 except as set forth therein, the authors retain all their rights.
1118 This document and the information contained herein are provided on
1119 an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE
1120 REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE
1121 IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL
1122 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
1123 WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE
1124 ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS
1125 FOR A PARTICULAR PURPOSE.
1128 Acknowledgment
1130 Funding for the RFC Editor function is currently provided by the
1131 Internet Society.
1138 Newman & Co Expires August 2008 FF[Page 19]

UW-IMAP'd extensions by yuuji