- TypeScript 89.7%
- JavaScript 3.1%
- HTML 2.1%
- Shell 1.8%
- Java 1.1%
- Other 2.1%
Names: POST /api/aliases refuses a member's chosen address on a shared domain (403 names_here_are_random) and draws a random one; the operator chooses anywhere, and a member chooses on a custom domain they own and have verified (mayChooseName in src/lib/name-policy.ts). GET /api/domains says where the account chooses (chooseOn); the Names form, compose's From picker, the Names import and the extension (1.2.2) follow it.
Previews and subjects: an HTML-only letter's text now comes from its decoded HTML part rather than the raw quoted-printable body, whose soft breaks split character references ("T7;", "ß;" mid-word); the preview builder undoes quoted-printable before references; one RFC 2047 decoder (src/lib/encoded-words.ts) drops the space between adjacent encoded-words and keeps a character split across two whole. Previews already sealed with the leftovers are repaired when shown.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|---|---|---|
| .claude | ||
| .github | ||
| android | ||
| bridge | ||
| deploy/box | ||
| design | ||
| e2e | ||
| extension | ||
| ios | ||
| public | ||
| scripts | ||
| smoke | ||
| src | ||
| workers | ||
| .env.example | ||
| .gitignore | ||
| app-worker.mjs | ||
| AUDIT-SCOPE.md | ||
| capacitor.config.ts | ||
| CONSTITUTION.md | ||
| CONTRIBUTING.md | ||
| DEPLOYMENT.md | ||
| E2E-STATUS.md | ||
| eslint.config.mjs | ||
| GROWTH-PLAN.md | ||
| IMPROVEMENT-PLAN.md | ||
| LAUNCH-GUIDE.md | ||
| LICENSE | ||
| MASHRABIYA.md | ||
| next.config.ts | ||
| NOTICE | ||
| open-next.config.ts | ||
| package-lock.json | ||
| package.json | ||
| PAYMENT-PLAN.md | ||
| playwright.config.ts | ||
| playwright.smoke.config.ts | ||
| postcss.config.mjs | ||
| README.md | ||
| ROADMAP.md | ||
| RocMail-SPEC.md | ||
| SECURITY.md | ||
| SELF-HOSTING.md | ||
| TESTING-ROADMAP.md | ||
| THREAT-MODEL.md | ||
| tsconfig.json | ||
| vitest.config.ts | ||
| wrangler.email.example.toml | ||
| wrangler.example.toml | ||
RocMail — بريد يحفظ أسراره
End-to-end encrypted email with a constitution the code cannot quietly betray.
RocMail is a paid, privacy-first mail service built for people whose correspondence must survive hostile interest — journalists, activists, and anyone who thinks a mailbox should belong to the person it addresses. It is self-hostable by design: an instance is a deployment with its own domain, keys and database, and the code carries no instance's name — identity is configuration, refused when missing. The authors' public instance is announced on its own domain.
This repository is the entire service: the app, the workers, the schema, and the test suite that enforces its promises. The tests are the marketing — the claim "the server cannot read your mail" is a spec you can run. The canonical home is git.mocipher.com/m01/rocmail-public — our own forge, not a rented one.
The five claims, each verifiable
-
A constitution enforced by the build. CONSTITUTION.md names twelve articles — No Watchers, Custody Without Sight, No Back Door at Any Price, Right of Departure — and each article's Enforced by line names real mechanisms in this repo. A guard test (src/tests/constitution.test.ts) reads the constitution, extracts every named mechanism, and fails the build if one disappears from the source. Where code and constitution disagree, the code is the defect.
-
The server's own key was destroyed, on the record. Mail was once encrypted at rest with a server-held key. In August 2026 every message was migrated into user-sealed envelopes and the server key was destroyed — ledger in E2E-STATUS.md. What a subpoena reaches now is ciphertext the operator cannot open.
-
Sealed with Mashrabiya, a post-quantum hybrid. Bodies, subjects, senders, attachments and their filenames, drafts and contacts are sealed at ingest with Mashrabiya v2 — X-Wing (ML-KEM-768 + X25519), AES-256-GCM per message — behind an Argon2id vault whose secret exists only in the user's unlocked browser. Search runs on your own devices: each keeps its own index, sealed under the vault, and the server is told nothing about a search — it only sees each device download every letter once (SECURITY.md, Known Limitations 2). The construction is specified, versioned and pinned by known-answer tests in MASHRABIYA.md.
-
Payment that cannot identify you. Money buys a voucher; the voucher feeds any account. The voucher table has no user column — the join between payment identity and mailbox identity is never stored. Rails: cash by mail, Monero, Bitcoin. Flat €5/month at every block length, because a discount is a lever and levers get pulled.
-
An administrator who cannot read. Owner and admin roles manage account shells — suspend, invite, mint vouchers. The strongest query any role can run against the mail store meets ciphertext. This is structural, not policy, and the e2e suite probes it from the outside.
Also true, and stated plainly: zero third-party requests on every page
(CSP-enforced, test-enforced), full Arabic RTL as a first-class locale (the
public site in English and Arabic, the app in English, German and Arabic),
standard mbox + sealed-archive export of the whole mailbox always available,
drafts sealed before they leave the tab, a block list the server cannot read,
names made at random on the instance's domain and never issued twice, and deletion that is immediate, irreversible,
and the user's act alone — with the one limit stated: a backup taken before a
deletion keeps the old wraps until it ages out, and each instance's /privacy
says how long that is.
Mail clients, too. bridge/ is a local IMAP, POP3 and SMTP bridge for
Thunderbird and Apple Mail: it signs in like a browser tab, opens the vault on
your own machine, keeps what it has opened in a sealed local store, and serves
127.0.0.1 only — folders, flags and incremental sync over IMAP since
2026-10-24 (bridge/README.md). The server cannot tell it
from a browser tab. It has 65 unit tests, one of them a real IMAP
conversation over a socket; a check against a live Thunderbird and Apple Mail
is still owed.
What we do not claim
The honest limits live in THREAT-MODEL.md: a web client
means you trust the code the server sends on each visit — narrowed, not
removed: every build publishes /release.json (the commit and the SHA-256 of
each file served from the static directories, the service worker among them),
/transparency shows it, and the browser extension hashes what an open RocMail
tab loaded against it. That manifest is the server's own statement, the server
can tell the extension's requests from the page's, the HTML of each page is not
covered, and a rebuild is shown to match only on the machine that built it; SMTP metadata exists while mail
transits; the service has not yet had a third-party audit — the source and the
suite are the interim evidence. If a privacy product won't tell you what it can't do,
it is describing a mood, not a system.
Architecture
Browser (Mashrabiya vault: Argon2id → X-Wing keys, seal/unseal, the search index, sealed)
│ ciphertext only
▼
Next.js 16 app (OpenNext on Cloudflare Workers, or `next start` on a Node box) — API routes, roles, billing gates
│
├── D1 / SQLite (dual-engine schema, migrated by the app itself on first request):
│ sealed envelopes, sealed lists, users, vouchers (no user column), instance settings
└── Email worker (workers/email-handler/, typed modules; email-handler.js is the entry):
ingest → seal at arrival → store; outbound through your SMTP relay; the
15-minute cron (scheduled sends, trash and spam retention, the retention table
in src/lib/retention.ts, the key-succession pass)
bridge/ (on your own machine): IMAP + POP3 + SMTP on 127.0.0.1, a sealed local store
- Dual engine: every schema and query runs on Cloudflare D1 and plain SQLite, so the same code serves the hosted service and a self-hosted box.
- Tests: a unit board (vitest, 52 files) including the constitution guard
and the Mashrabiya known-answer vectors, and a Playwright e2e suite (52 specs)
across Chromium, Firefox, and WebKit that exercises real flows — sealing,
roles, billing lifecycle, RTL, offline; the counts are kept honest in
ROADMAP.md.
verify.ymlruns types, lint (no errors, no new warnings), the unit board with its coverage floor and the Chromium e2e board on every push;nightly.ymlruns all three engines every night;weekly.ymlaudits dependencies, smokes the live instance and drills a restore.
Self-hosting
The service you can run is the service we run. Start with
SELF-HOSTING.md. The public RocMail is built for a single
box — own hardware, privacy jurisdiction, Tor onion service — and the box is
files in this repository: deploy/box/ (provision, Postfix + rspamd, Caddy,
alerting, dated encrypted backups, RESTORE.md), rehearsed on a VM by
deploy/box/rehearsal/run.sh. The owner's private instance stays on Cloudflare
(DEPLOYMENT.md is that path); the two share nothing but the
code, which names neither.
npm ci # Node 24; install scripts run only for packages listed in allowScripts
cp .env.example .env.local # every variable the code reads, with local values
npm run dev # app on localhost with the SQLite engine
npm test # unit board, constitution guard included
npm run test:e2e # Playwright suite (see e2e/README for harness notes)
What's next
ROADMAP.md is the single answer: what is built, what is blocked on hardware, what is blocked on a decision, and what waits on the first ten users. Every other document here is a governing text, a ledger, or one slice in depth.
Documents that govern
| Document | What it binds |
|---|---|
| ROADMAP.md | What happens next, and who each item waits on |
| CONSTITUTION.md | The twelve articles; supremacy over code |
| THREAT-MODEL.md | What we defend against, what we cannot |
| SECURITY.md | Every mechanism, and how to report a vulnerability |
| MASHRABIYA.md | The encryption, specified byte for byte, with its test vectors |
| SELF-HOSTING.md | Run it yourself |
| PAYMENT-PLAN.md | The voucher severance design, decided |
| CONTRIBUTING.md | Constitution-first rule for changes |
License
AGPL-3.0. If you run a modified RocMail as a service, your users are entitled to your source — the license exists so that "inspectable" cannot be quietly taken away downstream. The third-party data and code copied into the repository, and their licences, are listed in NOTICE.