# Epistula Domi — core (public) Epistula is the Domi family mail client. This repository is the **public, MPL-2.0 core**, `epistula-core`: everything that reads or writes mail content, so that anyone can check how hostile mail is handled. The app (Tauri, storage, IMAP/SMTP, UI) lives in the private `Epistula` repo and depends on this one by git tag. Remote: `https://gitea.marek-novak.cz/mnovak/EpistulaPublic.git` (public; a read-only GitHub mirror for CI). ## What is here ``` src/mime.rs parse (mail-parser): bodies, attachments, inline cid parts, headers src/compose.rs compose (mail-builder): multipart/alternative, attachments, reply, reply all, forward src/filename.rs hostile attachment names -> safe names (../, reserved Windows names, bidi controls) src/thread.rs threading: Message-ID / In-Reply-To / References, normalised-subject fallback src/rules.rs incoming rules (from/to/subject contains -> move to folder), first match wins; Sieve export src/sanitize.rs HTML sanitiser (ammonia allow-list), remote images -> placeholders, the dark reader's colours src/sanitize/colour.rs CSS colours: parse, WCAG contrast, grey, lighten in hue to 4.5 : 1 src/search.rs search query parser (free text, from:, to:, subject:, has:attachment, is:starred) -> FTS5 tests/ the mandatory tests (fixtures are built in code; no corpora in git) ``` ## Commands ``` cargo test # all mandatory tests (unit + proptest) cargo test --release # same; the 8 MB fixture is faster ``` On the dev machine set `CARGO_HOME=F:\C-Drive-Migration\future-caches\cargo` (C: is off limits). ## Rules - **Pure.** No I/O, no clock, no randomness, no network. Message-IDs and dates are parameters. - Mail is hostile input: never panic on it, never `unwrap()` on it. Every limit is a constant with a test. - Commits: `[core] : `. **No AI attribution in commits, PRs or tags, ever.** - Branch → Gitea PR via API (`$GITEA_TOKEN`, never echoed) → self-review in the PR body → merge `--no-ff` → push → `git rev-parse HEAD origin/main` twice the same. A release is a tag `vX.Y.Z`; the app bumps its tag. - Tests first. Quote counts. No binaries or test corpora in git. - The rules model must stay expressible as Sieve (`header :contains` + `fileinto`): V2 compiles it.