Display-Based Address Sorting for the IMAP4 SORT Extension
updates
- rfc-5256 — Internet Message Access Protocol - SORT and THREAD Extensions
Extracted elements (12)
DISPLAYFROM and DISPLAYTO sort on the full decoded addr-name and do not attempt locale- or language-dependent parsing to extract semantically meaningful substrings such as a surname, keeping the implementation simple and language-neutral.
The existing FROM and TO sort criteria in RFC 5256 sort lexically on addr-mailbox, which does not match what users typically see. DISPLAYFROM/DISPLAYTO address this by sorting on addr-name (the display name), providing a user-visible ordering.
This document updates RFC 5256 (SORT). A server advertising SORT=DISPLAY must support the full SORT extension in addition to the two new DISPLAYFROM and DISPLAYTO criteria.
A message's sort value under DISPLAYFROM and DISPLAYTO orderings MUST be derived from the IMAP envelope structure resulting from a FETCH ENVELOPE on the message.
The active RFC 4790 collation as per RFC 5255 MUST be used when sorting the string-based DISPLAYFROM and DISPLAYTO sort criteria.
When the addr-name is non-NIL, RFC 5255 Section 4.6 procedure MUST be applied: decode any RFC 2047 encoded-words and convert the result into a charset valid for the active RFC 4790 collation (default UTF-8).
DISPLAYFROM and DISPLAYTO are two new sort criteria for the IMAP SORT extension. DISPLAYFROM sorts on the first From header address's display name; DISPLAYTO sorts on the first To header address's display name.
The DISPLAY sort value for an address is determined by a priority chain: (1) decoded addr-name if non-NIL and non-empty, (2) addr-mailbox@addr-host if both non-NIL, (3) addr-mailbox if non-NIL, (4) empty string.
The SORT=DISPLAY capability indicates a server supports the full SORT extension as well as both the DISPLAYFROM and DISPLAYTO sort criteria. It is advertised in the server's CAPABILITY response.
This document registers the SORT=DISPLAY capability in the IMAP capabilities registry. IMAP capabilities are registered by publishing a Standards Track or IESG-approved Experimental RFC.
This document defines an additional IMAP4 capability and does not change the underlying security considerations of IMAP. No new security issues are introduced.
The ABNF extension adds 'SORT=DISPLAY' to the capability non-terminal and adds 'DISPLAYFROM' / 'DISPLAYTO' to the sort-key non-terminal, as defined in RFC 5234.