Skip to content

feat: IMAP STATUS, SUBSCRIBE/LSUB, real INTERNALDATE #100

@Jaro-c

Description

@Jaro-c

Problem

Three gaps blocking real IMAP client compatibility (part of #81):

  1. No STATUS command — every MUA polls STATUS before selecting; without it clients can't detect new mail without re-SELECTing.
  2. No SUBSCRIBE/UNSUBSCRIBE/LSUB — legacy clients (Thunderbird default, mutt, iOS Mail) rely on LSUB to enumerate mailboxes; LIST alone is insufficient.
  3. INTERNALDATE returns 1970-01-01 — clients use INTERNALDATE for message sort and display; the epoch placeholder breaks chronological ordering.

Fix

  • STATUS handler computes MESSAGES, RECENT, UIDNEXT, UIDVALIDITY, UNSEEN from a snapshot without requiring selection.
  • Subscriptions persisted to accounts/<name>/.subscriptions. INBOX always subscribed.
  • MessageRef stores file mtime; FETCH INTERNALDATE returns actual delivery time in RFC 3501 format.

Tests

  • status_reports_counts_for_inbox — counts correct before/after STORE
  • status_requires_authentication_and_existing_mailbox — auth + existence guards
  • subscribe_and_lsub_flow — subscribe/unsubscribe/lsub round-trip
  • internaldate_is_not_epoch — ensures epoch placeholder is gone
  • internaldate_format_sanity — verifies date arithmetic

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions