Add export-managesieve: an archive's Sieve scripts into any ManageSieve server #31

Merged
jcoffey-dev merged 1 commits from feat/export-managesieve into main 2026-10-30 07:53:35 +00:00
Owner

inbuxa-migrate export-managesieve --url sieve://host --auth-basic USER ARCHIVE writes an archive's Sieve scripts into any ManageSieve server (RFC 5804). It is half of the last open part of the store-independence gate item; the CalDAV/CardDAV push comes next.

  • Stateless like export-imap: LISTSCRIPTS, then PUTSCRIPT for each script that is missing or whose content differs (compared with GETSCRIPT). A second run writes nothing, and nothing is ever deleted.
  • The archive's active script is made active with SETACTIVE. With none active in the archive, the target's choice stays.
  • A script the server refuses is counted as failed with its reason, and the run goes on.
  • --dry-run checks each script it would write with CHECKSCRIPT when the server has it (VERSION advertised).

Tested live against the Dovecot rig: dry run 2/1 with nothing written, export 2 created and 1 refused, rerun 0/0/2, read back exactly with import managesieve, and a changed script is the only update. Also covered by a mock-server test in tests/mock_managesieve.rs that CI runs. cargo test --locked, clippy and fmt are clean.

`inbuxa-migrate export-managesieve --url sieve://host --auth-basic USER ARCHIVE` writes an archive's Sieve scripts into any ManageSieve server (RFC 5804). It is half of the last open part of the store-independence gate item; the CalDAV/CardDAV push comes next. - Stateless like `export-imap`: LISTSCRIPTS, then PUTSCRIPT for each script that is missing or whose content differs (compared with GETSCRIPT). A second run writes nothing, and nothing is ever deleted. - The archive's active script is made active with SETACTIVE. With none active in the archive, the target's choice stays. - A script the server refuses is counted as failed with its reason, and the run goes on. - `--dry-run` checks each script it would write with CHECKSCRIPT when the server has it (VERSION advertised). Tested live against the Dovecot rig: dry run 2/1 with nothing written, export 2 created and 1 refused, rerun 0/0/2, read back exactly with `import managesieve`, and a changed script is the only update. Also covered by a mock-server test in `tests/mock_managesieve.rs` that CI runs. `cargo test --locked`, clippy and fmt are clean.
jcoffey-dev added 1 commit 2026-10-30 07:50:20 +00:00
Add export-managesieve: an archive's Sieve scripts into any ManageSieve server
ci / test (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 2m51s
ci / announce (pull_request) Skipped
3f1e0ea775
Lists the target's scripts, PUTSCRIPTs each one that is missing or
differs, and makes the archive's active script active with SETACTIVE.
Stateless like export-imap, so a second run writes nothing; nothing is
deleted. A refused script is counted with the server's reason and the
run goes on. --dry-run checks each script with CHECKSCRIPT where the
server has it.

Live-tested against the Dovecot rig (tests/integration_export_managesieve.rs)
and with the mock server; the live export-imap test is now listed in
usage.md too.
jcoffey-dev merged commit ae4e1acb98 into main 2026-10-30 07:53:35 +00:00
jcoffey-dev deleted branch feat/export-managesieve 2026-10-30 07:53:35 +00:00
Sign in to join this conversation.