The server-to-server leg of the neutral export, for a target that speaks neither JMAP nor takes files.
inbuxa-migrate export-imap --url imaps://host --auth-basic USER [--dry-run] ARCHIVE
It keeps no state, the same as export. Each run reads the target folder first (UID, flags, size, and the Message-ID/From/To/Subject/Date headers), matching by Message-ID, or by sender, subject, date and recipients when there is none, with size deciding between equals. Missing messages are appended with their flags and arrival time; flags are brought up to date on messages already there. A rerun writes nothing, and an interrupted run is finished by running it again without doubling anything.
Folders: INBOX first. Sent, drafts, trash, junk and archive go to the folder the server marks with SPECIAL-USE (e.g. [Gmail]/Sent Mail), created with USE where CREATE-SPECIAL-USE is offered. Everything else goes under the personal namespace with the server's separator; that separator inside a name becomes _. Names are sent as UTF-8 under UTF8=ACCEPT, modified UTF-7 otherwise.
Flags: the four system flags, plus keywords where PERMANENTFLAGS allows them (with a count of what was left off). $deleted is never carried.
A message the server refuses counts as failed and the run goes on; a dropped connection ends the run.
IMAP client changes:
append uses LITERAL+, or waits for the go-ahead; a NO before the go-ahead ends the command without sending the literal.
New CREATE (with USE), SUBSCRIBE and UID STORE FLAGS.SILENT.
The FETCH parser now reads BODY[HEADER.FIELDS (...)] as one item. Before this, it split at the parenthesis.
Checked locally:
cargo test --locked: all 32 binaries pass; clippy and fmt are clean.
Live:cargo test --test integration_export_imap -- --ignored against the Dovecot rig passes. It exports 7 messages into 6 folders (nested, Équipe & co, Q1/Q2, one message in two folders, one with no Message-ID). Read back with import imap, the folder/subject → keywords map matches exactly, arrival time included. The second run is 0 created, 0 updated, 7 unchanged. After changing one flag, the third run is 0/1/6.
Mock:tests/mock_imap.rs covers the synchronizing literal, LITERAL+, and a NO before the go-ahead.
Not in this PR: CalDAV/CardDAV/ManageSieve pushes, --prune, and folder filters.
The server-to-server leg of the neutral export, for a target that speaks neither JMAP nor takes files.
```
inbuxa-migrate export-imap --url imaps://host --auth-basic USER [--dry-run] ARCHIVE
```
**It keeps no state, the same as `export`.** Each run reads the target folder first (UID, flags, size, and the Message-ID/From/To/Subject/Date headers), matching by Message-ID, or by sender, subject, date and recipients when there is none, with size deciding between equals. Missing messages are appended with their flags and arrival time; flags are brought up to date on messages already there. A rerun writes nothing, and an interrupted run is finished by running it again without doubling anything.
- **Folders:** INBOX first. Sent, drafts, trash, junk and archive go to the folder the server marks with SPECIAL-USE (e.g. `[Gmail]/Sent Mail`), created with `USE` where `CREATE-SPECIAL-USE` is offered. Everything else goes under the personal namespace with the server's separator; that separator inside a name becomes `_`. Names are sent as UTF-8 under `UTF8=ACCEPT`, modified UTF-7 otherwise.
- **Flags:** the four system flags, plus keywords where PERMANENTFLAGS allows them (with a count of what was left off). `$deleted` is never carried.
- A message the server refuses counts as failed and the run goes on; a dropped connection ends the run.
**IMAP client changes:**
- `append` uses LITERAL+, or waits for the go-ahead; a NO before the go-ahead ends the command without sending the literal.
- New `CREATE` (with `USE`), `SUBSCRIBE` and `UID STORE FLAGS.SILENT`.
- The FETCH parser now reads `BODY[HEADER.FIELDS (...)]` as one item. Before this, it split at the parenthesis.
**Checked locally:**
- `cargo test --locked`: all 32 binaries pass; clippy and fmt are clean.
- **Live:** `cargo test --test integration_export_imap -- --ignored` against the Dovecot rig passes. It exports 7 messages into 6 folders (nested, `Équipe & co`, `Q1/Q2`, one message in two folders, one with no Message-ID). Read back with `import imap`, the folder/subject → keywords map matches exactly, arrival time included. The second run is 0 created, 0 updated, 7 unchanged. After changing one flag, the third run is 0/1/6.
- **Mock:** `tests/mock_imap.rs` covers the synchronizing literal, LITERAL+, and a NO before the go-ahead.
Not in this PR: CalDAV/CardDAV/ManageSieve pushes, `--prune`, and folder filters.
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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The server-to-server leg of the neutral export, for a target that speaks neither JMAP nor takes files.
It keeps no state, the same as
export. Each run reads the target folder first (UID, flags, size, and the Message-ID/From/To/Subject/Date headers), matching by Message-ID, or by sender, subject, date and recipients when there is none, with size deciding between equals. Missing messages are appended with their flags and arrival time; flags are brought up to date on messages already there. A rerun writes nothing, and an interrupted run is finished by running it again without doubling anything.[Gmail]/Sent Mail), created withUSEwhereCREATE-SPECIAL-USEis offered. Everything else goes under the personal namespace with the server's separator; that separator inside a name becomes_. Names are sent as UTF-8 underUTF8=ACCEPT, modified UTF-7 otherwise.$deletedis never carried.IMAP client changes:
appenduses LITERAL+, or waits for the go-ahead; a NO before the go-ahead ends the command without sending the literal.CREATE(withUSE),SUBSCRIBEandUID STORE FLAGS.SILENT.BODY[HEADER.FIELDS (...)]as one item. Before this, it split at the parenthesis.Checked locally:
cargo test --locked: all 32 binaries pass; clippy and fmt are clean.cargo test --test integration_export_imap -- --ignoredagainst the Dovecot rig passes. It exports 7 messages into 6 folders (nested,Équipe & co,Q1/Q2, one message in two folders, one with no Message-ID). Read back withimport imap, the folder/subject → keywords map matches exactly, arrival time included. The second run is 0 created, 0 updated, 7 unchanged. After changing one flag, the third run is 0/1/6.tests/mock_imap.rscovers the synchronizing literal, LITERAL+, and a NO before the go-ahead.Not in this PR: CalDAV/CardDAV/ManageSieve pushes,
--prune, and folder filters.