Problem
StatusDataItemName and StatusDataItem in imap-types do not have Size variants for the STATUS=SIZE extension (RFC 8438), which is also a mandatory baseline item in IMAP4rev2 (RFC 9051 §6.3.10).
Unlike StatusDataItemName::Deleted and StatusDataItem::DeletedStorage (which were added as a feature-gated extension), Size has no representation at all — and neither enum has an Other escape hatch. This means:
- A server cannot respond to
STATUS mailbox (SIZE) requests through the typed API.
- The library parser rejects the
SIZE item in incoming STATUS commands before the application sees them.
- Advertising
STATUS=SIZE in CAPABILITY while being unable to parse or respond to it is worse than not advertising it.
Suggested API
Following the pattern of ext_condstore_qresync / DeletedStorage:
// In StatusDataItemName
#[cfg(feature = "ext_status_size")]
Size,
// In StatusDataItem
#[cfg(feature = "ext_status_size")]
Size(u64),
The value should be u64 to match RFC822.SIZE semantics (sum of per-message octet counts; can exceed u32::MAX for large mailboxes).
Context
This was discovered while implementing IMAP4rev2 support. Capability::Other provides an escape hatch for unknown capabilities, but StatusDataItemName has no equivalent. We filed #702 for Capability::Imap4Rev2 and are tracking this as a separate gap.
RFC 9051 §6.3.10 lists SIZE, DELETED, and DELETED-STORAGE as mandatory STATUS data items for IMAP4rev2. DELETED and DELETED-STORAGE are already present; SIZE is the missing one.
Problem
StatusDataItemNameandStatusDataIteminimap-typesdo not haveSizevariants for theSTATUS=SIZEextension (RFC 8438), which is also a mandatory baseline item in IMAP4rev2 (RFC 9051 §6.3.10).Unlike
StatusDataItemName::DeletedandStatusDataItem::DeletedStorage(which were added as a feature-gated extension),Sizehas no representation at all — and neither enum has anOtherescape hatch. This means:STATUS mailbox (SIZE)requests through the typed API.SIZEitem in incomingSTATUScommands before the application sees them.STATUS=SIZEinCAPABILITYwhile being unable to parse or respond to it is worse than not advertising it.Suggested API
Following the pattern of
ext_condstore_qresync/DeletedStorage:The value should be
u64to matchRFC822.SIZEsemantics (sum of per-message octet counts; can exceedu32::MAXfor large mailboxes).Context
This was discovered while implementing IMAP4rev2 support.
Capability::Otherprovides an escape hatch for unknown capabilities, butStatusDataItemNamehas no equivalent. We filed#702forCapability::Imap4Rev2and are tracking this as a separate gap.RFC 9051 §6.3.10 lists
SIZE,DELETED, andDELETED-STORAGEas mandatorySTATUSdata items for IMAP4rev2.DELETEDandDELETED-STORAGEare already present;SIZEis the missing one.