# ADR 0003 — Write our own crates; use Stalwart's primitives, never its server **Status:** Accepted, 2026-09-02. ## The licence boundary Stalwart Labs ships two distinct things: | | Licence | Us | |---|---|---| | The **server** (`stalwartlabs/stalwart`, `crates/*`) | `AGPL-3.0-only OR LicenseRef-SEL` | ❌ never | | The **primitives** (`mail-parser`, `mail-auth`, `mail-builder`, `mail-send`, `smtp-proto`) | `Apache-2.0 OR MIT` | ✅ dependencies | DANE and MTA-STS live in `crates/smtp` and `crates/common` — **on the AGPL side of that line.** That is precisely why we write our own. ## Rule - Depending on the permissive primitive crates is fine and intended. - Reading the AGPL server crates for *understanding* is fine. - Copying, adapting or transliterating any line from them is **not**, and would contaminate the whole workspace. When implementing DANE or MTA-STS, work from the RFCs (7672, 8461, 6698) — not from `stalwart/crates/smtp`. - The research mirror at `~/Desktop/ProjectMail/mail-servers/stalwart` is read-only reference. Same for `maddy` (GPL-3) and `BillionMail` (AGPL). ## Which of our crates get published Tier 1 (`mail-dane`, `mail-mta-sts`, `mail-dsn`) are published standalone: they depend on nothing in this workspace, they fill real holes in the ecosystem, and their value to us is partly that other projects audit them. Names verified available on crates.io 2026-09-02, as is `openmail` itself — reserve early. Tier 2 and 3 stay in-workspace until their APIs settle.