50 lines
3.3 KiB
Markdown
50 lines
3.3 KiB
Markdown
# mailu — recipe-maintainer → cc-ci parity (Phase 2 P2)
|
|
|
|
**P2 is VACUOUS for mailu:** there is no `recipe-info/mailu/tests/` corpus in the recipe-maintainer
|
|
workspace (`/srv/recipe-maintainer`), so there are no recipe-maintainer tests to port. Coverage is
|
|
therefore health + recipe-specific functional tests (P3), authored from what mailu *is* (a full
|
|
email stack: nginx front + admin + postfix/smtp + dovecot/imap + rspamd/antispam + webmail + redis).
|
|
|
|
## cc-ci deployment notes
|
|
- `COMPOSE_FILE=compose.yml` (base). recipe_meta.EXTRA_ENV(domain) pins `MAIL_DOMAIN`/`HOSTNAMES` to
|
|
the per-run domain, `TRAEFIK_STACK_NAME=traefik_ci_commoninternet_net` (so the external
|
|
`*_letsencrypt` volume the certdumper mounts resolves), and **`TLS_FLAVOR=notls`** — mailu's
|
|
mail-port TLS normally comes from `certdumper` dumping traefik's ACME `acme.json`, but cc-ci uses a
|
|
file-provider wildcard cert (no ACME), so there is no acme.json; `notls` removes that dependency.
|
|
(certdumper still runs idle; harmless — it converges 1/1.) Web/admin is served over the real
|
|
wildcard TLS via Traefik. Mail ports 25/465/587/110/143/993/995 are published mode:host → on-host
|
|
(cc-ci-run) tests reach SMTP/IMAP at 127.0.0.1.
|
|
|
|
## Recipe-specific functional tests (P3 — ≥2)
|
|
1. `functional/test_mailbox.py` — §4.3 create-an-object + read-back: create a mailbox via the admin
|
|
container's `flask mailu user` CLI, then read it back from `flask mailu config-export --json` and
|
|
assert the address is present (admin-DB provisioning round-trip).
|
|
2. `functional/test_mail_flow.py` — the characteristic end-to-end mail flow: INJECT a uniquely-marked
|
|
message to the mailbox via the postfix container's local `sendmail` (locally-originated → not
|
|
greylisted), then VERIFY delivery+storage via dovecot's `doveadm search` in the imap container —
|
|
a real postfix → rspamd → dovecot deliver/store/fetch round-trip. We use the in-container mail
|
|
tools (not the host network ports) because TLS_FLAVOR=notls makes dovecot refuse plaintext auth
|
|
over the network (143); the in-container path exercises the same delivery/storage stack. (A
|
|
network IMAP-auth test was dropped: under notls dovecot disallows plaintext network auth, so a
|
|
host-side login is not a meaningful signal here.)
|
|
|
|
## Backup data-integrity (P4) — COVERED (phase-mailu, 2026-06-11)
|
|
|
|
P4 is now **earned** via recipe-mirror PR#3 (`add-backupbot-labels`) on
|
|
`git.autonomic.zone/recipe-maintainers/mailu`. That PR adds backupbot v2 labels to the `admin`
|
|
service (`/data` — sqlite DB) and `imap` service (`/mail` — Maildir), making `backup_capable=True`
|
|
at the PR head.
|
|
|
|
cc-ci tests (all in `tests/mailu/`):
|
|
- `ops.py` — `pre_backup`: seeds `citest@<domain>` via `flask mailu user`; `pre_restore`: deletes
|
|
it via sqlite3 Python to simulate data loss.
|
|
- `test_backup.py` — asserts `citest@<domain>` is in `config-export` at backup time.
|
|
- `test_restore.py` — asserts `citest@<domain>` is back in `config-export` after restore.
|
|
|
|
Auto-detected: `generic.backup_capable()` scans the compose.yml for `backupbot.backup.*true` and
|
|
returns `True` at the PR head — no `BACKUP_CAPABLE` override needed in `recipe_meta.py`.
|
|
|
|
## Browser flow (P6)
|
|
Not added: mailu's user-facing UX (webmail/admin) is a standard web UI; the characteristic behaviour
|
|
(mail send/receive, account auth) is covered functionally above. No Playwright flow owed.
|