Closed duesee closed 6 months ago
search-criteria = charset 1*(SP search-key)
capability =/ "SORT"
; From RFC 5957
capability =/ "SORT=DISPLAY"
sort = ["UID" SP] "SORT" SP sort-criteria SP search-criteria
sort-criteria = "(" sort-criterion *(SP sort-criterion) ")"
sort-criterion = ["REVERSE" SP] sort-key
sort-key = "ARRIVAL" / "CC" / "DATE" / "FROM" / "SIZE" / "SUBJECT" / "TO"
; From RFC 5957
sort-key =/ "DISPLAYFROM" / "DISPLAYTO"
sort-data = "SORT" *(SP nz-number)
capability =/ "THREAD=" thread-alg
thread = ["UID" SP] "THREAD" SP thread-alg SP search-criteria
thread-alg = "ORDEREDSUBJECT" / "REFERENCES" / thread-alg-ext
thread-alg-ext = atom
thread-data = "THREAD" [SP 1*thread-list]
thread-list = "(" (thread-members / thread-nested) ")"
thread-members = nz-number *(SP nz-number) [SP thread-nested]
thread-nested = 2*thread-list
capability =/ "SORT"
; FROM RFC 5957
capability =/ "SORT=DISPLAY"
sort-key =/ "DISPLAYFROM" / "DISPLAYTO"
capability =/ "THREAD=" thread-alg
subject = *subj-leader [subj-middle] *subj-trailer
subj-leader = (*subj-blob subj-refwd) / WSP
subj-blob = "[" *BLOBCHAR "]" *WSP
; Any CHAR8 except '[' and ']'. SHOULD comply with [UTF-8].
BLOBCHAR = %x01-5a / %x5c / %x5e-ff
subj-refwd = ("re" / ("fw" ["d"])) *WSP [subj-blob] ":"
; Last subj-blob is subj-base if subj-base would otherwise be empty.
subj-middle = *subj-blob (subj-base / subj-fwd)
; Can be a subj-blob.
subj-base = NONWSP *(*WSP NONWSP)
; Any CHAR8 other than WSP. SHOULD comply with [UTF-8].
NONWSP = %x01-08 / %x0a-1f / %x21-ff
subj-fwd = subj-fwd-hdr subject subj-fwd-trl
subj-fwd-hdr = "[fwd:"
subj-fwd-trl = "]"
subj-trailer = "(fwd)" / WSP
See https://datatracker.ietf.org/doc/html/rfc5256.
(This would potentially be very useful for Himalaya.)