duesee / imap-codec

Rock-solid and complete codec for IMAP
Apache License 2.0
35 stars 13 forks source link

feat: Implement `UIDPLUS` #377

Closed duesee closed 2 months ago

duesee commented 8 months ago

RFC 2359 obsoleted by RFC 4315.

capability      =/ "UIDPLUS"
command-select  =/ uid-expunge

uid-expunge     = "UID" SP "EXPUNGE" SP sequence-set
; incorporated before the expansion rule of atom [SP 1*<any TEXT-CHAR except "]">]
; that appears in [[IMAP](https://www.rfc-editor.org/rfc/rfc4315#ref-IMAP)]
resp-text-code  =/ resp-code-apnd / resp-code-copy / "UIDNOTSTICKY"

resp-code-apnd  = "APPENDUID" SP nz-number SP append-uid

append-uid      = uniqueid

resp-code-copy  = "COPYUID" SP nz-number SP uid-set SP uid-set

uid-set         = (uniqueid / uid-range) *("," uid-set)

; two uniqueid values and all values between these two regards of order.
; Example: 2:4 and 4:2 are equivalent.
uid-range       = (uniqueid ":" uniqueid)

Additionally if MULTIAPPEND is supported

; only permitted if client uses [[MULTIAPPEND](https://www.rfc-editor.org/rfc/rfc4315#ref-MULTIAPPEND)] to append multiple messages.
append-uid      =/ uid-set

Questions

; Strictly ascending
uniqueid = nz-number

A "UID set" is similar to the IMAP sequence set; however, the "*" value for a sequence number is not permitted.