Add export-files: an archive as Maildir, vCard, iCalendar and Sieve files #26

Merged
jcoffey-dev merged 1 commits from feat/export-files into main 2026-10-30 05:42:15 +00:00
Owner

The way out of an archive for anything that doesn't speak JMAP. This is the neutral export: mail, contacts, calendars and filters leave in open formats, without this tool or any vendor's store format.

inbuxa-migrate export-files [--objects <list>] [--dry-run] <ARCHIVE> <DIR>
DIR/
  mail/            Maildir++ (Dovecot/Courier layout, modified UTF-7 names, dovecot-keywords)
  contacts/*.vcf   one per address book, vCard 4.0
  calendars/*.ics  one VCALENDAR per calendar, X-WR-CALNAME, each time zone once
  sieve/*.sieve
  files/
  manifest.json    real folder names, roles, active script, identities, links; written last
  • No network. DIR must be new or empty and is made 0700.
  • Every name comes from the source, so each becomes one safe path component (no separators or .., no Windows-reserved names), and clashes are numbered, case-blind.
  • Photos and attachments are inlined as data: URIs, the same as export.
  • Links are listed in the manifest and never created.

The readers it round-trips through:

  • import maildir decodes modified UTF-7 folder names and reads dovecot-keywords (roadmap phase 3, item 11).
  • import takeout unfolds and unescapes X-WR-CALNAME/X-WR-CALDESC.

Checked locally: cargo test --locked (all 31 test binaries pass) and clippy clean on the new code. The new tests are tests/export_files.rs (write out, then read back with import maildir and import takeout; also refusal of a non-empty dir, dry run, --objects, missing archive) plus 14 unit tests.

Not in this PR: pushing to an IMAP, CalDAV or CardDAV server; the admin manifest of accounts and domains; Maildir names containing . (they become _, and the manifest keeps the real name). scripts/export_archive.py (inherited, writes calendars and contacts as JSON) is left alone; this supersedes it.

The way out of an archive for anything that doesn't speak JMAP. This is the neutral export: mail, contacts, calendars and filters leave in open formats, without this tool or any vendor's store format. ``` inbuxa-migrate export-files [--objects <list>] [--dry-run] <ARCHIVE> <DIR> ``` ``` DIR/ mail/ Maildir++ (Dovecot/Courier layout, modified UTF-7 names, dovecot-keywords) contacts/*.vcf one per address book, vCard 4.0 calendars/*.ics one VCALENDAR per calendar, X-WR-CALNAME, each time zone once sieve/*.sieve files/ manifest.json real folder names, roles, active script, identities, links; written last ``` - No network. `DIR` must be new or empty and is made 0700. - Every name comes from the source, so each becomes one safe path component (no separators or `..`, no Windows-reserved names), and clashes are numbered, case-blind. - Photos and attachments are inlined as `data:` URIs, the same as `export`. - Links are listed in the manifest and never created. The readers it round-trips through: - `import maildir` decodes modified UTF-7 folder names and reads `dovecot-keywords` (roadmap phase 3, item 11). - `import takeout` unfolds and unescapes `X-WR-CALNAME`/`X-WR-CALDESC`. **Checked locally:** `cargo test --locked` (all 31 test binaries pass) and clippy clean on the new code. The new tests are `tests/export_files.rs` (write out, then read back with `import maildir` and `import takeout`; also refusal of a non-empty dir, dry run, `--objects`, missing archive) plus 14 unit tests. Not in this PR: pushing to an IMAP, CalDAV or CardDAV server; the admin manifest of accounts and domains; Maildir names containing `.` (they become `_`, and the manifest keeps the real name). `scripts/export_archive.py` (inherited, writes calendars and contacts as JSON) is left alone; this supersedes it.
jcoffey-dev added 1 commit 2026-10-30 05:37:29 +00:00
Add export-files: an archive as Maildir, vCard, iCalendar and Sieve files
ci / test (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 4m23s
ci / announce (pull_request) Skipped
fe96d7d234
The way out of an archive for anything that doesn't speak JMAP: mail as a
Maildir++ tree Dovecot and Courier serve as it is, each address book as a
.vcf, each calendar as one .ics, Sieve scripts, the file tree, and a
manifest.json with what those formats don't hold (real folder names, roles,
the active script, identities, links). No network; a new or empty
directory only, private to its owner; every name from the source made safe
as a path. Photos and attachments are inlined as data: URIs, as export
sends them. Links are listed, never made.

The readers it round-trips through get what that needs:
- import maildir decodes modified UTF-7 folder names and reads each
  folder's dovecot-keywords, so Junk and labels come back;
- import takeout unfolds and unescapes X-WR-CALNAME and X-WR-CALDESC.

tests/export_files.rs writes an archive out and reads it back with import
maildir and import takeout.
jcoffey-dev merged commit 8f7de44134 into main 2026-10-30 05:42:15 +00:00
jcoffey-dev deleted branch feat/export-files 2026-10-30 05:42:15 +00:00
Sign in to join this conversation.