Security & privacy

A mail platform is a catastrophic thing to get wrong. So we didn't hope — we designed.

Security is one of the six product pillars, threat-modelled from the crown jewels down: mail content, credentials, DKIM keys, tenant isolation, the audit trail, and backups. Here's what protects each.

4
independent authorization walls before any cross-tenant read
0
credentials in JavaScript — sessions are server-side only
≤30s
to revoke a session everywhere, across all surfaces
RLS
Postgres row-level security as the final, code-proof wall

Tenant isolation

Four walls, each of which alone would stop a leak.

A cross-tenant data access is a Severity-1 incident by definition. So isolation is not one check — it's four independent layers, probed on every release with wrong-tenant and wrong-role credentials.

1 — Role check

Capability-based scopes (platform / tenant / domain / mailbox) evaluated per endpoint from the session. Deny-by-default: no annotation means no access.

2 — Entitlement check

Plan gates for every feature and quota, enforced server-side and cached to stay off the hot path.

3 — Resource guard

Ownership is validated on every id-bearing route — a mailbox, a domain, an account id from the client is never trusted on its face.

4 — Postgres row-level security

The application role runs with RLS unbypassable, so even a code-level authorization bug cannot read across tenants. There is no "bypass RLS" mode: a super admin binds a tenant, it never removes the walls.

Authentication

Passkeys first. No tokens the browser could leak.

Passkeys, TOTP & hardened passwords

WebAuthn passkeys (passkey-only accounts allowed), TOTP 2FA a tenant can mandate, and Argon2id password hashing with an offline breach-list check and exponential lockout.

BFF cookie sessions

Access and refresh tokens live server-side only, behind an HttpOnly, Secure, SameSite cookie. JavaScript never touches a credential — XSS can't steal what the page never holds.

Step-up for sensitive actions

Impersonation, tenant deletion, DKIM key export, routing changes and API-key creation require fresh re-auth — enforced by a server-side policy, not a UI convention.

Central identity, break-glass safe

One OIDC hub with per-surface sessions and SSO; tenants can federate their own IdP, while a native owner credential always keeps a broken IdP from locking anyone out.

The XSS / SSRF frontier

Where webmail products get owned — hardened on purpose.

Rendering untrusted HTML mail is the most dangerous thing a mail client does. AshuMail's pipeline gets tests, not trust.

Allowlist sanitization on read

Scripts, forms, event handlers and external CSS stripped; SVG neutered to static; links forced to rel="noopener noreferrer".

Sandboxed iframe with its own CSP

Mail renders in a no-scripts, no-navigation iframe under a strict default-src 'none' policy — a boundary inside the client.

SSRF-hardened image proxy

Remote images are signed and proxied — resolve-then-connect with private, link-local and metadata IP ranges denied, DNS-rebinding pinned, redirects capped, image content-type enforced. Trackers die; one fetch serves every reader.

Attachments scanned, then served coldly

Downloadable only post-scan, with Content-Disposition: attachment and nosniff, from a cookie-less path. HTML and SVG attachments never render inline.

Privacy & data protection

Your mail is yours — including from the people who run it.

No ambient content access

No role — including platform super admin — has ambient access to mail content. Helpdesk works from metadata only: sessions, quota, delivery events, never the message.

Encryption in transit & at rest

TLS 1.3 preferred everywhere, including internal traffic. AES-256-GCM envelope encryption for sensitive fields; DKIM private keys wrapped at rest and never leaving the server in the clear.

No phone-home, egress allowlisted

Fonts and icons are self-hosted, not fetched from a CDN. Outbound network access is allowlisted by destination class, so a compromised module can't quietly exfiltrate.

Honest scope. Because you host it, the platform operator (you) is trusted in v1 — that's the one adversary deliberately out of scope. Message bodies are stored so search and filtering work; per-message encryption at rest and end-to-end PGP/S-MIME are on the roadmap, decided deliberately for their search and AI trade-offs rather than shipped as a slogan.

Accountability

Tamper-evident audit trail.

Hash-chained log

Every sensitive action is written in the same transaction as its effect, hash-chained so tampering is detectable — with a green/red chain badge in the console.

Visible by design

Impersonation shows a red banner while active; every helpdesk action tells the user "this access is logged". A chain-verification failure pages an operator.

Supply chain

Built from source, signed, pinned.

SBOM & dependency gates

A CycloneDX SBOM per release; dependency and image scanning in CI where a critical finding fails the build. No :latest anywhere.

Signed images & managed secrets

Digest-pinned base images, cosign signatures verified at deploy, secrets injected at runtime via a SOPS + age vault — never baked into images or committed to git.

See what it takes to run it yourself.

A mail-capable VPS, your domains, and a one-command install. Here's the honest checklist.