Drafts and queued sends are one outbox row in different states, drained
by a background worker so SMTP never runs in the request path (§3.3).
Retries back off 1-16 min; 5xx, auth and TLS failures fail fast; items
a crashed worker left mid-send are reclaimed. Each message keeps its
Message-ID across retries, so an at-least-once duplicate is recognisable.
Reply headers are derived server-side from the parent, and sent mail is
filed into its thread alongside received mail.
Three things the libraries would have got wrong:
- mail-builder's .bcc() writes an ordinary Bcc header every recipient
sees. Bcc goes in the envelope only; a test checks it never reaches the
rendered bytes, and was confirmed to fail if .bcc() is reintroduced.
- mail-send trusts only compiled-in public CAs, while IMAP (native-tls)
uses the OS store — a server with an internal-CA cert would sync but
never send. SMTP now uses the OS store too.
- rustls is added with default-features off: its defaults pull in
aws-lc-rs, which needs cmake/clang and would break the runner build.
Also fixes: UIDVALIDITY resets now only delete IMAP-sourced rows (sent
mail shares the table and exists nowhere else); first sync no longer
logs a false "UIDVALIDITY changed" warning; Message-IDs are stored bare
whichever path writes them (ENVELOPE brackets them, mail-parser doesn't);
accounts can choose STARTTLS vs implicit TLS for SMTP, defaulting by port.
Verified end to end against a TLS mail server with a private-CA cert,
with no plaintext patching: IMAPS sync, SMTPS send, delivery and headers
checked from the recipients' mailboxes, Bcc absent from other copies,
plaintext refused when STARTTLS is unavailable, retry scheduling on
connection failure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds GET /api/threads, grouped server-side: a thread's messages are
spread through the flat list by date, so a client grouping page-by-page
would split threads across page boundaries and miscount unread. The
thread detail endpoint now returns bodies too, so opening a conversation
is one request rather than one per message.
Fixes three routes that have been dead since the first commit. axum 0.7
spells a path parameter ':id'; '{id}' is axum 0.8 syntax and was being
matched as a literal segment, so GET /api/messages/<id>, GET
/api/threads/<id> and DELETE /api/accounts/<id> all 404'd. This fails
silently — no compile or startup error — and the original smoke test
only exercised list endpoints. Found by clicking a conversation in the
webapp.
Adds tests/routes.rs to cover route shape, verified to fail against the
old syntax.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The v0.2.0 release log was 17k lines, ~12k of which were BuildKit's
animated progress display repainting itself with cursor-movement
escapes. --progress=plain emits one line per event instead.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Without .dockerignore the build context included target/ — gigabytes
sent to the daemon before the build even starts, on a host where disk
has already been a constraint. Verified the image builds, runs
migrations and serves /healthz.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A single runner serves all three repos, so superseded pushes queueing up
full builds is a real cost. Releases are left uncovered deliberately:
cancelling a publish halfway is worse than running it twice.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
First CI run failed with "linker cc not found" — the runner executes
jobs on the host, so the C toolchain a container image would normally
provide has to be installed there. Records the fix, and notes openssl-devel
as the next thing that would break so it can be installed in one go.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Match the setup already working on that runner: setup-* actions to
provision toolchains rather than host-installed tooling, and the
automatic GITHUB_TOKEN. Registry push keeps a dedicated REGISTRY_TOKEN,
since the automatic token's scope doesn't reliably cover packages.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Flags were stored via Debug formatting of async-imap's Flag enum, which
produced Rust-internal spellings ("Seen", "Custom(\"$Junk\")") that don't
round-trip back through Flag::from and aren't what the schema documents.
Map to canonical wire spelling (\Seen, $Junk) before the webapp starts
depending on it, with tests pinning the format.
Adds Gitea Actions CI/release workflows, an nginx rate-limiting config
for the §7 gap, and a shared release-process doc. Records the decision
not to reconcile server-side flag changes or deletions, with the
conditions that should trigger revisiting it.
Also applies rustfmt and clears clippy, so CI passes from the first run.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Covers phases 1-2 of the build order in the architecture spec: the IMAP
sync engine (IDLE + UIDVALIDITY tracking + jittered reconnect, headers
first with lazy body fetch), the full data model, and a minimal REST API
for auth, accounts, folders, messages and delta polling.
Credentials are encrypted at rest with ChaCha20-Poly1305 rather than
libsodium secretbox, to avoid a system dependency for the same
construction.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>