draft-ietf-imapext-sort-02.txt   draft-ietf-imapext-sort-03.txt 
Network Working Group M. Crispin Network Working Group M. Crispin
INTERNET-DRAFT: IMAP SORT University of Washington INTERNET-DRAFT: IMAP SORT University of Washington
Document: internet-drafts/draft-ietf-imapext-sort-02.txt June 2000 Document: internet-drafts/draft-ietf-imapext-sort-03.txt June 2000
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 37 skipping to change at page 1, line 37
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, describing an expanded A revised version of this draft document, describing an expanded
version of this protocol extension, will be submitted to the RFC version of this protocol extension, will be submitted to the RFC
editor as a Proposed Standard for the Internet Community. editor as a Proposed Standard for the Internet Community.
Discussion and suggestions for improvement are requested, and should Discussion and suggestions for improvement are requested, and should
be sent to ietf-imapext@IMC.ORG. This document will expire before 8 be sent to ietf-imapext@IMC.ORG. This document will expire before 22
December 2000. Distribution of this memo is unlimited. December 2000. 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
skipping to change at page 3, line 9 skipping to change at page 3, line 9
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, tenatively called the the SORT extension described in this document, tenatively called the
SORT2 extension. SORT2 extension.
Extracted Subject Text Extracted Subject Text
The "SUBJECT" SORT criteria uses a version of the subject which has The "SUBJECT" SORT criteria uses a version of the subject which has
specific subject artifacts of deployed Internet mail software specific subject artifacts of deployed Internet mail software
removed. Due to the complexity of these artifacts, the above syntax removed. Due to the complexity of these artifacts, the formal syntax
is ambiguous. The following procedure is followed to determing the for the subject extraction rules is ambiguous. The following
actual "base subject" which is used to sort by subject: procedure is followed to determing the actual "base subject" which is
used to sort by subject:
(1) Remove all trailing text of the subject that matches (1) Convert any RFC 2047 encoded-words in the subject to
UTF-8. Convert all tabs and continuations to space.
Convert all multiple spaces to a single space.
(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.
(2) Remove all prefix text of the subject that matches (3) Remove all prefix text of the subject that matches the
subj-leader. subj-leader ABNF.
(3) If there is prefix text of the subject that matches (4) If there is prefix text of the subject that matches the
subj-blob, and removing that prefix leaves a non-empty subj-blob ABNF, and removing that prefix leaves a non-empty
subj-base, then remove the prefix text. subj-base, then remove the prefix text.
(4) Repeat (2) and (3) until no matches remain. (5) Repeat (3) and (4) until no matches remain.
(5) Convert any RFC 2047 encoded-words in the remaining Note: it is possible to defer step (2) until step (6), but this
subj-base to UTF-8. requires checking for subj-trailer in step (4).
(6) The resulting text is the "base subject" used in the (6) If the resulting text begins with the subj-fwd-hdr ABNF
and ends with the subj-fwd-trl ABNF, remove the
subj-fwd-hdr and subj-fwd-trl and repeat from step (2).
(7) The resulting text is the "base subject" used in the
SORT. SORT.
All servers and disconnected clients MUST use exactly this algorithm All servers and disconnected clients MUST use exactly this algorithm
when sorting by subject. Otherwise there is potential for a user to when sorting by subject. Otherwise there is potential for a user to
get inconsistant results based on whether they are running in get inconsistant results based on whether they are running in
connected or disconnected IMAP mode. connected or disconnected IMAP mode.
Additional Commands Additional Commands
This command is an extension to the IMAP4rev1 base protocol. This command is an extension to the IMAP4rev1 base protocol.
skipping to change at page 8, line 18 skipping to change at page 8, line 18
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 (1)-(5): The following syntax describes 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-hdr = "[fwd:"
subj-fwd-trl = "]"
subj-leader = (*subj-blob subj-refwd) / WSP subj-leader = (*subj-blob subj-refwd) / WSP
subj-middle = *subj-blob subj-base subj-middle = *subj-blob (subj-base / subj-fwd)
; last subj-blob is subj-base if subj-base would ; last subj-blob is subj-base if subj-base would
; otherwise be empty ; otherwise be empty
subj-trailer = "(fwd)" / WSP subj-trailer = "(fwd)" / WSP
subj-base = NONWSP *([*WSP] NONWSP) subj-base = NONWSP *([*WSP] NONWSP)
; can be a subj-blob ; can be a subj-blob
BLOBCHAR = %x01-5c / %x5e-7f BLOBCHAR = %x01-5c / %x5e-7f
; any CHAR except ']' ; any CHAR except ']'
 End of changes. 

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