apache / apache/magpie

feat(tools/mail-source/mbox): land concrete CLI wiring for the mbox stub

Open
#304 0 comments 0 reactions 0 assignees View on GitHub
capability:platform enhancement family:tools good first issue
Dominant language
Python
Stars
92
Forks
92
Avg merge
1d 12h
Merged PRs (30d)
104

Description

The mbox / local-archive mail-source adapter is currently a documentation stub. Land the concrete CLI per [`tools/mail-source/mbox/README.md`](../tree/main/tools/mail-source/mbox/README.md). Read-only by construction — no drafts, no writes to the archive file.

**Operations to implement:**

- `list_recent_threads(list, since)` — parse mbox, group messages by `References:` / `In-Reply-To:`, filter by `Date:`
- `read_thread(thread_id)` — return full message history for the thread root
- `thread_url(thread_id)` — build archive deep-link if the adopter has a public archive (PonyMail / Hyperkitty / Pipermail), else `file://`

Format sniffing should accept: a single mbox file, a `Maildir/` directory, or a directory of `.eml` files.

**Why:**

- **Forensics / late triage** — the inbox is gone but a snapshot exists.
- **Air-gapped triage** — a thumbdrive snapshot of `security@` for an audit window.
- **Compliance / discovery exports** — a regulator-requested mbox export, processed through the same skills without touching live credentials.

**Reference:**

- Contract: [`tools/mail-source/contract.md`](../tree/main/tools/mail-source/contract.md)
- Stub spec: [`tools/mail-source/mbox/README.md`](../tree/main/tools/mail-source/mbox/README.md)
- Python `mailbox` (stdlib) handles mbox + Maildir + MH + Babyl

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.