Skip to content

feat(imap-types): add StatusDataItemName::Size and StatusDataItem::Size for RFC 8438 / RFC 9051 #704

Description

@MarkAtwood

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:

  1. A server cannot respond to STATUS mailbox (SIZE) requests through the typed API.
  2. The library parser rejects the SIZE item in incoming STATUS commands before the application sees them.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions