feat(tools/mail-source/imap): land concrete CLI wiring for the IMAP stub
- Dominant language
- Python
- Stars
- 92
- Forks
- 92
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 104
Description
The IMAP mail-source adapter is currently a documentation stub — the contract is defined but no executable lands the actual operations. Land the concrete CLI per [`tools/mail-source/imap/README.md`](../tree/main/tools/mail-source/imap/README.md).
**Operations to implement** (per the [mail-source contract](../tree/main/tools/mail-source/contract.md)):
- `list_recent_threads(list, since)` — `IMAP SEARCH SINCE ` against the configured folder
- `read_thread(thread_id)` — fetch by Message-ID + walk `References:` / `In-Reply-To:` chain
- `list_drafts(thread_id)` — list Drafts folder filtered to thread
- `list_sent_since(thread_id, since)` — search Sent folder
- `create_draft(thread_id, body)` — `APPEND` to Drafts with the threading headers from [`tools/gmail/threading.md`](../tree/main/tools/gmail/threading.md) (the threading rule is shared across backends)
- `thread_url(thread_id)` — build archive deep-link (Hyperkitty / PonyMail / Pipermail) per the adopter's public archive, or fall back to `imap://`
**Why:** Many projects run on corporate IMAP (Office 365, Fastmail, self-hosted Dovecot, Cyrus) — Gmail-only forecloses those adopters. An IMAP backend is also the natural choice for shared role mailboxes (e.g. `security@project.org`) that aren't on Gmail.
**Reference:**
- Contract: [`tools/mail-source/contract.md`](../tree/main/tools/mail-source/contract.md)
- Stub spec (capability claim already declared): [`tools/mail-source/imap/README.md`](../tree/main/tools/mail-source/imap/README.md)
- Existing Gmail backend for reference shape: [`tools/gmail/tool.md`](../tree/main/tools/gmail/tool.md)
- Python `imaplib` (stdlib) is sufficient; `aioimaplib` for async if preferred
Contributor guide
Assessment
This issue has not been assessed yet.