5957
PROPOSED STANDARD
Display-Based Address Sorting for the IMAP4 SORT Extension
Authors: D. Karp
Date: July 2010
Area: app
Working Group: morg
Stream: IETF
Updates:
RFC 5256
Abstract
This document describes an IMAP protocol extension enabling server- side message sorting on the commonly displayed portion of the From and To header fields. [STANDARDS-TRACK]
RFC 5957
PROPOSED STANDARD
Internet Engineering Task Force (IETF) D. Karp
Request for Comments: 5957 Zimbra
Updates: <a href="./rfc5256">5256</a> July 2010
Category: Standards Track
ISSN: 2070-1721
<span class="h1">Display-Based Address Sorting for the IMAP4 SORT Extension</span>
Abstract
This document describes an IMAP protocol extension enabling server-
side message sorting on the commonly displayed portion of the From
and To header fields.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="https://www.rfc-editor.org/info/rfc5957">http://www.rfc-editor.org/info/rfc5957</a>.
Copyright Notice
Copyright (c) 2010 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
<span class="grey">Karp IMAP4 Display-Based Address Sorting [Page 1]</span>
<span id="page-2" ></span>
<span class="grey"><a href="./rfc5957">RFC 5957</a> July 2010</span>
Table of Contents
<a href="#section-1">1</a>. Introduction ....................................................<a href="#page-2">2</a>
<a href="#section-2">2</a>. Conventions Used in This Document ...............................<a href="#page-2">2</a>
<a href="#section-3">3</a>. DISPLAY Sort Value for an Address ...............................<a href="#page-2">2</a>
<a href="#section-4">4</a>. The DISPLAYFROM and DISPLAYTO Sort Criteria .....................<a href="#page-3">3</a>
<a href="#section-5">5</a>. Formal Syntax ...................................................<a href="#page-3">3</a>
<a href="#section-6">6</a>. Security Considerations .........................................<a href="#page-3">3</a>
<a href="#section-7">7</a>. Internationalization Considerations .............................<a href="#page-4">4</a>
<a href="#section-8">8</a>. IANA Considerations .............................................<a href="#page-4">4</a>
<a href="#section-9">9</a>. Normative References ............................................<a href="#page-4">4</a>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
The [<a href="#ref-SORT" title=""Internet Message Access Protocol - SORT and THREAD Extensions"">SORT</a>] extension to the [<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>] protocol provides a means for the
server-based sorting of messages. It defines a set of sort criteria
and the mechanism for determining the sort value of a message for
each such ordering.
The [<a href="#ref-SORT" title=""Internet Message Access Protocol - SORT and THREAD Extensions"">SORT</a>] FROM and TO orderings sort messages lexically on the
[<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>] addr-mailbox of the first address in the message's From and To
headers, respectively. This document provides two alternative
orderings, DISPLAYFROM and DISPLAYTO, which sort messages based on
the first From or To address's [<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>] addr-name (generally the same
as its [<a href="./rfc5322" title=""Internet Message Format"">RFC5322</a>] display-name), when present.
A server that supports the full [<a href="#ref-SORT" title=""Internet Message Access Protocol - SORT and THREAD Extensions"">SORT</a>] extension as well as both the
DISPLAYFROM and DISPLAYTO sort criteria indicates this by returning
"SORT=DISPLAY" in its CAPABILITY response.
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Conventions Used in This Document</span>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>].
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. DISPLAY Sort Value for an Address</span>
For the purposes of the sort criteria defined in this document, the
sort value for an [<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>] address structure is defined as follows:
o If the address structure's [<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>] addr-name is non-NIL, apply the
procedure from <a href="./rfc5255#section-4.6">[RFC5255], Section 4.6</a>. (That is, decode any
[<a href="./rfc2047" title=""MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text"">RFC2047</a>] encoded-words and convert the resulting character string
into a charset valid for the currently active [<a href="./rfc4790" title=""Internet Application Protocol Collation Registry"">RFC4790</a>] collation,
with a default of UTF-8.) If the resulting octet string is not
the empty string, use it as the sort value for the address.
<span class="grey">Karp IMAP4 Display-Based Address Sorting [Page 2]</span>
<span id="page-3" ></span>
<span class="grey"><a href="./rfc5957">RFC 5957</a> July 2010</span>
o Otherwise, if the address structure's [<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>] addr-mailbox and
[<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>] addr-host are both non-NIL, the sort value for the address
is addr-mailbox@addr-host.
o Otherwise, if the address structure's [<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>] addr-mailbox is non-
NIL, the sort value for the address is its addr-mailbox.
o If none of the above conditions are met, the sort value for the
address is the empty string.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. The DISPLAYFROM and DISPLAYTO Sort Criteria</span>
This document introduces two new [<a href="#ref-SORT" title=""Internet Message Access Protocol - SORT and THREAD Extensions"">SORT</a>] sort criteria, DISPLAYFROM
and DISPLAYTO. A message's sort value under these orderings MUST be
derived as follows:
A "derived-addr" value is created from the [<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>] envelope structure
resulting from a FETCH ENVELOPE on the message. For DISPLAYFROM, the
derived-addr value is the [<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>] env-from value. For DISPLAYTO, the
derived-addr value is the [<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>] env-to value.
o If the derived-addr value is NIL, the message's sort value is the
empty string.
o Otherwise, the message's sort value is the DISPLAY sort value of
the first [<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>] address in the derived-addr value.
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Formal Syntax</span>
The following syntax specification uses the Augmented Backus-Naur
Form (ABNF) notation as specified in [<a href="./rfc5234" title=""Augmented BNF for Syntax Specifications: ABNF"">RFC5234</a>]. [<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>] defines the
non-terminal "capability", and [<a href="#ref-SORT" title=""Internet Message Access Protocol - SORT and THREAD Extensions"">SORT</a>] defines "sort-key".
capability =/ "SORT=DISPLAY"
sort-key =/ "DISPLAYFROM" / "DISPLAYTO"
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Security Considerations</span>
This document defines an additional IMAP4 capability. As such, it
does not change the underlying security considerations of [<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>].
The author believes that no new security issues are introduced with
this additional IMAP4 capability.
<span class="grey">Karp IMAP4 Display-Based Address Sorting [Page 3]</span>
<span id="page-4" ></span>
<span class="grey"><a href="./rfc5957">RFC 5957</a> July 2010</span>
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Internationalization Considerations</span>
DISPLAYFROM and DISPLAYTO are string-based sort criteria. As stated
in [<a href="#ref-SORT" title=""Internet Message Access Protocol - SORT and THREAD Extensions"">SORT</a>], the active [<a href="./rfc4790" title=""Internet Application Protocol Collation Registry"">RFC4790</a>] collation as per [<a href="./rfc5255" title=""Internet Message Access Protocol Internationalization"">RFC5255</a>] MUST be
used when sorting such strings.
The DISPLAYFROM and DISPLAYTO orderings sort on the full decoded
[<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>] addr-name, when present. They do not attempt to parse this
string in a locale- or language-dependent manner in order to
determine and sort on some semantically meaningful substring such as
the surname.
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. IANA Considerations</span>
[<a id="ref-IMAP">IMAP</a>] capabilities are registered by publishing a Standards Track or
IESG-approved Experimental RFC. This document constitutes
registration of the SORT=DISPLAY capability in the [<a href="#ref-IMAP" title=""INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1"">IMAP</a>]
capabilities registry.
<span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. Normative References</span>
[<a id="ref-IMAP">IMAP</a>] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION
4rev1", <a href="./rfc3501">RFC 3501</a>, March 2003.
[<a id="ref-RFC2047">RFC2047</a>] Moore, K., "MIME (Multipurpose Internet Mail Extensions)
Part Three: Message Header Extensions for Non-ASCII Text",
<a href="./rfc2047">RFC 2047</a>, November 1996.
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
[<a id="ref-RFC4790">RFC4790</a>] Newman, C., Duerst, M., and A. Gulbrandsen, "Internet
Application Protocol Collation Registry", <a href="./rfc4790">RFC 4790</a>, March
2007.
[<a id="ref-RFC5234">RFC5234</a>] Crocker, D., Ed., and P. Overell, "Augmented BNF for
Syntax Specifications: ABNF", STD 68, <a href="./rfc5234">RFC 5234</a>, January
2008.
[<a id="ref-RFC5255">RFC5255</a>] Newman, C., Gulbrandsen, A., and A. Melnikov, "Internet
Message Access Protocol Internationalization", <a href="./rfc5255">RFC 5255</a>,
June 2008.
[<a id="ref-RFC5322">RFC5322</a>] Resnick, P., Ed., "Internet Message Format", <a href="./rfc5322">RFC 5322</a>,
October 2008.
<span class="grey">Karp IMAP4 Display-Based Address Sorting [Page 4]</span>
<span id="page-5" ></span>
<span class="grey"><a href="./rfc5957">RFC 5957</a> July 2010</span>
[<a id="ref-SORT">SORT</a>] Crispin, M. and K. Murchison, "Internet Message Access
Protocol - SORT and THREAD Extensions", <a href="./rfc5256">RFC 5256</a>, June
2008.
Author's Address
Dan Karp
Zimbra
3401 Hillview Avenue
Palo Alto, CA 94304
USA
EMail: [email protected]
URI: <a href="http://www.zimbra.com">http://www.zimbra.com</a>
Karp IMAP4 Display-Based Address Sorting [Page 5]
Annotations
Select text to annotate