draft-ietf-imapext-sort-09.txt   draft-ietf-imapext-sort-10.txt 
IMAP Extensions Working Group M. Crispin IMAP Extensions Working Group M. Crispin
INTERNET-DRAFT: IMAP SORT K. Murchison INTERNET-DRAFT: IMAP SORT K. Murchison
Document: internet-drafts/draft-ietf-imapext-sort-09.txt March 2002 Document: internet-drafts/draft-ietf-imapext-sort-10.txt June 2002
INTERNET MESSAGE ACCESS PROTOCOL - SORT EXTENSION INTERNET MESSAGE ACCESS PROTOCOL - SORT EXTENSION
Status of this Memo Status of this Memo
This document is an Internet-Draft and is in full conformance with This document is an Internet-Draft and is in full conformance with
all provisions of Section 10 of RFC 2026. all provisions of Section 10 of RFC 2026.
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
skipping to change at page 1, line 36 skipping to change at page 1, line 36
To view the list Internet-Draft Shadow Directories, see To view the list Internet-Draft Shadow Directories, see
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
A revised version of this document will be submitted to the RFC A revised version of this document will be submitted to the RFC
editor as an Informational Document for the Internet Community. editor as an Informational Document for the Internet Community.
A revised version of this draft document will be submitted to the RFC A revised version of this draft document will be submitted to the RFC
editor as a Proposed Standard for the Internet Community. Discussion editor as a Proposed Standard for the Internet Community. Discussion
and suggestions for improvement are requested, and should be sent to and suggestions for improvement are requested, and should be sent to
ietf-imapext@IMC.ORG. This document will expire before 21 September ietf-imapext@IMC.ORG. This document will expire before 22 December
2002. Distribution of this memo is unlimited. 2002. Distribution of this memo is unlimited.
Abstract Abstract
This document describes an experimental server-based sorting This document describes an experimental server-based sorting
extension to the IMAP4rev1 protocol, as implemented by the University extension to the IMAP4rev1 protocol, as implemented by the University
of Washington's IMAP toolkit. This extension provides substantial of Washington's IMAP toolkit. This extension provides substantial
performance improvements for IMAP clients which offer sorted views. performance improvements for IMAP clients which offer sorted views.
A server which supports this extension indicates this with a A server which supports this extension indicates this with a
capability name of "SORT". Client implementations SHOULD accept any capability name of "SORT". Client implementations SHOULD accept any
capability name which begins with "SORT" as indicating support for capability name which begins with "SORT" as indicating support for
the extension described in this document. This provides for future the extension described in this document. This provides for future
upwards-compatible extensions. upwards-compatible extensions.
At the time of this document was written, the IMAP Extensions Working At the time of this document was written, the IMAP Extensions Working
Group (IETF-IMAPEXT) was considering upwards-compatible additions to Group (IETF-IMAPEXT) was considering upwards-compatible additions to
the SORT extension described in this document, tentatively called the the SORT extension described in this document, tentatively called the
SORT2 extension. SORT2 extension.
Extracted Subject Text Base Subject Text
The "SUBJECT" SORT criteria uses a version of the subject which has The "SUBJECT" SORT criteria the "base subject," which has specific
specific subject artifacts of deployed Internet mail software subject artifacts of deployed Internet mail software removed. Due to
removed. Due to the complexity of these artifacts, the formal syntax the complexity of these artifacts, the formal syntax for the subject
for the subject extraction rules is ambiguous. The following extraction rules is ambiguous. The following procedure is followed
procedure is followed to determine the actual "base subject" which is to determine the actual "base subject" which is used to sort by
used to sort by subject: subject:
(1) Convert any RFC 2047 encoded-words in the subject to (1) Convert any RFC 2047 encoded-words in the subject to
UTF-8. Convert all tabs and continuations to space. UTF-8. Convert all tabs and continuations to space.
Convert all multiple spaces to a single space. Convert all multiple spaces to a single space.
(2) Remove all trailing text of the subject that matches (2) Remove all trailing text of the subject that matches
the subj-trailer ABNF, repeat until no more matches are the subj-trailer ABNF, repeat until no more matches are
possible. possible.
(3) Remove all prefix text of the subject that matches the (3) Remove all prefix text of the subject that matches the
skipping to change at page 5, line 9 skipping to change at page 5, line 9
collation algorithm (see under "Internationalization collation algorithm (see under "Internationalization
Considerations"). Considerations").
If two or more messages exactly match according to the sorting If two or more messages exactly match according to the sorting
criteria, these messages are sorted according to the order in criteria, these messages are sorted according to the order in
which they appear in the mailbox. In other words, there is an which they appear in the mailbox. In other words, there is an
implicit sort criterion of "sequence number". implicit sort criterion of "sequence number".
When multiple sort criteria are specified, the result is sorted in When multiple sort criteria are specified, the result is sorted in
the priority order that the criteria appear. For example, the priority order that the criteria appear. For example,
(SUBJECT DATE) will sort messages in order by their subject text; (SUBJECT DATE) will sort messages in order by their base subject
and for messages with the same subject text will sort by their text; and for messages with the same base subject text will sort
sent date. by their sent date.
Untagged EXPUNGE responses are not permitted while the server is Untagged EXPUNGE responses are not permitted while the server is
responding to a SORT command, but are permitted during a UID SORT responding to a SORT command, but are permitted during a UID SORT
command. command.
The defined sort criteria are as follows. Refer to the Formal The defined sort criteria are as follows. Refer to the Formal
Syntax section for the precise syntactic definitions of the Syntax section for the precise syntactic definitions of the
arguments. If the associated RFC-822 header for a particular arguments. If the associated RFC-822 header for a particular
criterion is absent, it is treated as the empty string. The empty criterion is absent, it is treated as the empty string. The empty
string always collates before non-empty strings. string always collates before non-empty strings.
skipping to change at page 6, line 9 skipping to change at page 6, line 9
This can be avoided by use of additional criteria, e.g. This can be avoided by use of additional criteria, e.g.
SUBJECT DATE vs. REVERSE SUBJECT REVERSE DATE. In general, SUBJECT DATE vs. REVERSE SUBJECT REVERSE DATE. In general,
however, it's better (and faster, if the client has a however, it's better (and faster, if the client has a
"reverse current ordering" command) to reverse the results "reverse current ordering" command) to reverse the results
in the client instead of issuing a new SORT. in the client instead of issuing a new SORT.
SIZE SIZE
Size of the message in octets. Size of the message in octets.
SUBJECT SUBJECT
Extracted subject text. Base subject text.
TO TO
RFC-822 local-part of the first "To" address. RFC-822 local-part of the first "To" address.
Example: C: A282 SORT (SUBJECT) UTF-8 SINCE 1-Feb-1994 Example: C: A282 SORT (SUBJECT) UTF-8 SINCE 1-Feb-1994
S: * SORT 2 84 882 S: * SORT 2 84 882
S: A282 OK SORT completed S: A282 OK SORT completed
C: A283 SORT (SUBJECT REVERSE DATE) UTF-8 ALL C: A283 SORT (SUBJECT REVERSE DATE) UTF-8 ALL
S: * SORT 5 3 4 1 2 S: * SORT 5 3 4 1 2
S: A283 OK SORT completed S: A283 OK SORT completed
skipping to change at page 8, line 11 skipping to change at page 8, line 11
delimited by a space. delimited by a space.
Example: S: * SORT 2 3 6 Example: S: * SORT 2 3 6
Formal Syntax of SORT commands and Responses Formal Syntax of SORT commands and Responses
sort-data = "SORT" *(SP nz-number) sort-data = "SORT" *(SP nz-number)
sort = ["UID" SP] "SORT" SP sort = ["UID" SP] "SORT" SP
"(" sort-criterion *(SP sort-criterion) ")" "(" sort-criterion *(SP sort-criterion) ")"
SP search_charset 1*(SP search_key) SP search-charset 1*(SP search-key)
sort-criterion = ["REVERSE" SP] sort-key sort-criterion = ["REVERSE" SP] sort-key
sort-key = "ARRIVAL" / "CC" / "DATE" / "FROM" / "SIZE" / sort-key = "ARRIVAL" / "CC" / "DATE" / "FROM" / "SIZE" /
"SUBJECT" / "TO" "SUBJECT" / "TO"
The following syntax describes subject extraction rules (2)-(6): The following syntax describes base subject extraction rules (2)-(6):
subject = *subj-leader [subj-middle] *subj-trailer subject = *subj-leader [subj-middle] *subj-trailer
subj-refwd = ("re" / ("fw" ["d"])) *WSP [subj-blob] ":" subj-refwd = ("re" / ("fw" ["d"])) *WSP [subj-blob] ":"
subj-blob = "[" *BLOBCHAR "]" *WSP subj-blob = "[" *BLOBCHAR "]" *WSP
subj-fwd = subj-fwd-hdr subject subj-fwd-trl subj-fwd = subj-fwd-hdr subject subj-fwd-trl
subj-fwd-hdr = "[fwd:" subj-fwd-hdr = "[fwd:"
skipping to change at page 10, line 6 skipping to change at page 10, line 6
internationalization. internationalization.
It is anticipated that there will be a generic Unicode sorting It is anticipated that there will be a generic Unicode sorting
collation, which will provide generic case-insensitivity for collation, which will provide generic case-insensitivity for
alphabetic scripts, specification of composed character handling, and alphabetic scripts, specification of composed character handling, and
language-specific sorting collations. A server which implements language-specific sorting collations. A server which implements
non-default sorting collations will modify its sorting behavior non-default sorting collations will modify its sorting behavior
according to the selected sorting collation. according to the selected sorting collation.
Non-English translations of "Re" or "Fw"/"Fwd" are not specified for Non-English translations of "Re" or "Fw"/"Fwd" are not specified for
removal in the extracted subject text process. By specifying that removal in the base subject extraction process. By specifying that
only the English forms of the prefixes are used, it becomes a simple only the English forms of the prefixes are used, it becomes a simple
display time task to localize the prefix language for the user. If, display time task to localize the prefix language for the user. If,
on the other hand, prefixes in multiple languages are permitted, the on the other hand, prefixes in multiple languages are permitted, the
result is a geometrically complex, and ultimately unimplementable, result is a geometrically complex, and ultimately unimplementable,
task. In order to improve the ability to support non-English display task. In order to improve the ability to support non-English display
in Internet mail clients, only the English form of these prefixes in Internet mail clients, only the English form of these prefixes
should be transmitted in Internet mail messages. should be transmitted in Internet mail messages.
Author's Address Author's Address
 End of changes. 

This html diff was produced by rfcdiff 1.23, available from http://www.levkowetz.com/ietf/tools/rfcdiff/