Add export-imap: an archive's mail into any IMAP server #27

Merged
jcoffey-dev merged 1 commits from feat/export-imap into main 2026-10-30 06:18:49 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev 50942574ea Add export-imap: an archive's mail into any IMAP server
ci / test (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 3m11s
ci / announce (pull_request) Skipped
For a target that speaks neither JMAP nor takes files. Like export it
keeps no state: each run reads the target folder (UID, flags, size and
the match headers), appends what's missing with its flags and arrival
time, and brings flags up to date on what's there, so a second run writes
nothing and an interrupted one is finished by running it again.

Folders follow the server: INBOX, the SPECIAL-USE folder for sent,
drafts, trash, junk and archive (created with the mark where allowed),
everything else under the personal namespace with the server's
separator. Keywords go where PERMANENTFLAGS allows; $deleted never does.

The IMAP client gains APPEND (LITERAL+ or the go-ahead, with a NO before
it ending the command cleanly), CREATE, SUBSCRIBE and UID STORE, and
reads a FETCH section with a header list as one item.

tests/integration_export_imap.rs (live Dovecot, ignored like the other
container tests) round-trips through import imap and checks the second
and third runs; tests/mock_imap.rs covers both literal paths and the
early NO.
2026-10-29 23:14:41 -07:00