Add an end-to-end integration harness that runs the webmail against a real Stalwart mail server in Docker and drives it with Playwright, focused on the mail/folder synchronisation behaviour (unread/total counters, folder-list sync, account-scoped Unified Mailbox) that the unified-mailbox work touches. - integration/ stack: Stalwart (declarative bootstrap: alice/bob/carol, submission + IMAP listeners, permissive CORS) + webmail (dev mode, so the browser's plaintext cross-origin JMAP calls aren't blocked by the prod CSP). - Helpers: dependency-free SMTP submit client, JMAP client for seeding / inspecting server state, and page helpers (login, add/switch account, locale-independent folder-counter reads). - Specs: login, single-account sync (receive/read/move/delete/folder-create/ burst) and multi-account (per-account isolation + cross-account Unified Inbox aggregation + background-account delivery). 12 tests, all green. - Add focused data-testid hooks to the mail UI (folder rows + counters, email list items, account switcher, composer) for stable selectors. - Exclude examples/ and integration/ from tsconfig/eslint/.dockerignore.
30 lines
1.3 KiB
Docker
30 lines
1.3 KiB
Docker
# Stalwart Mail Server with a declarative bootstrap for webmail integration
|
|
# testing.
|
|
#
|
|
# Extends the official image with stalwart-cli and an entrypoint that, on first
|
|
# container start, applies the bootstrap + account plans against the freshly
|
|
# started server. On subsequent starts the `.bootstrap-applied` marker short-
|
|
# circuits both phases and Stalwart boots straight into normal mode.
|
|
#
|
|
# NOTE: stalwart-cli is COPYed in rather than downloaded during the build. The
|
|
# binary is fetched by ./prepare-stalwart-cli.sh (run for you by the Playwright
|
|
# global-setup / integration runner). This keeps the build offline-friendly and
|
|
# avoids the base image's apt sources, which are unreachable in sandboxed CI.
|
|
|
|
FROM stalwartlabs/stalwart:v0.16
|
|
|
|
USER root
|
|
|
|
# Host-prefetched stalwart-cli matching the build architecture.
|
|
COPY stalwart-cli /usr/local/bin/stalwart-cli
|
|
|
|
RUN mkdir -p /etc/stalwart-bootstrap
|
|
COPY plan-bootstrap.ndjson /etc/stalwart-bootstrap/plan-bootstrap.ndjson
|
|
COPY plan-accounts.ndjson.tpl /etc/stalwart-bootstrap/plan-accounts.ndjson.tpl
|
|
COPY entrypoint.sh /usr/local/bin/stalwart-bootstrap-entrypoint.sh
|
|
RUN chmod +x /usr/local/bin/stalwart-cli /usr/local/bin/stalwart-bootstrap-entrypoint.sh
|
|
|
|
USER stalwart
|
|
|
|
ENTRYPOINT ["/usr/local/bin/stalwart-bootstrap-entrypoint.sh"]
|