feat: end-to-end test and docs for the archive import

- Import a Mailman-style mbox through the CLI inside the container: encoded headers, multipart, escaped From lines, threading, idempotence
- Check accent-insensitive search and the public page hiding addresses
- Document the migration from Mailman in the README and the endpoint in OpenAPI
This commit is contained in:
tgiachi 2026-11-09 19:52:14 +01:00
commit b777acc154

View file

@ -61,6 +61,7 @@ parsimony member import dev@example.org subscribers.txt # "email[,name]" per l
parsimony held ls dev@example.org
parsimony held approve 12
parsimony archive ls dev@example.org --q "deploy"
parsimony archive import dev@example.org dev.mbox # an mbox file or "-" for stdin
parsimony queue ls
parsimony --json list ls # JSON for scripts
parsimony help
@ -71,6 +72,23 @@ Exit status: 0 success, 1 failure (including lines that failed in `member import
`parsimony serve -config FILE` runs the daemon; the old `parsimony -config FILE` form still works.
In the container: `docker exec parsimony /parsimony list ls`.
## Migrating from Mailman
Both Mailman 2 and Mailman 3 (HyperKitty) can export a list's history as an mbox file.
```
parsimony list add dev@example.org --title "Developers"
parsimony member import dev@example.org subscribers.txt # "email[,name]" per line
parsimony archive import dev@example.org dev.mbox
```
The import reads standard mbox (a message starts at a `From addr Tue Jan 2 15:04:05 2024` line, `>From ` escapes are
restored), decodes encoded headers, charsets and multipart bodies, and stores the plain text. It is safe to repeat: a
message already in the archive (same `Message-ID`) is skipped. Threads are rebuilt from `In-Reply-To` whatever the order
of the messages. Messages that cannot be read are listed and counted, and the exit status is 1; the others are kept.
It works whatever the list's archive policy is (the policy only governs live mail). The admin UI has the same import on
the Archive tab. Search is accent-insensitive: `caffe` finds "Caffè".
## Docker
The image runs as an unprivileged user (uid 65532) and works with a read-only root filesystem.