Redakt
A design-first, open-source mail provider. Add a domain you own, publish DNS, and read mail in a quiet desktop shell.
Redakt is the product layer: onboarding, DNS, accounts, and the inbox. Stalwart is the mail engine (SMTP, JMAP, IMAP, DKIM). This repository is MIT and does not fork Stalwart. Stalwart stays AGPL when you run it.
The project is early (0.1.0). Demo mode is the fastest way to look at the product. Live mode talks to a real mail engine on your machine.
Interface inspiration: Define and Tatem.
Run it
You need pnpm 11 and Node 20+. Live mode also needs Docker.
Demo
No Postgres, no Stalwart, no port 25.
cp .env.example .env
pnpm install
pnpm devOpen http://localhost:3000. Demo mode keeps a local session and loads fixture .eml files from fixtures/. Seed login is ada@redakt.local / demo.
Live (Postgres + Stalwart)
cp .env.example .env
pnpm install
pnpm dev:liveThat starts Postgres and Stalwart, pushes the schema, and runs the app with DEMO_MODE=false.
| Service | Port |
|---|---|
| Redakt | 3000 |
| Postgres | 5432 |
| Stalwart HTTP / JMAP | 8080 |
| SMTP / SMTPS / IMAPS | 25 / 465 / 993 |
On first Stalwart boot, finish the wizard at http://localhost:8080/admin (admin / changeme unless you changed .env). Copy the generated admin into .env, close that tab, and use Redakt at http://localhost:3000.
The Stalwart Dashboard on HTTP will loop on a browser sign-in prompt. Cancel it. Redakt talks to Stalwart over JMAP, not that screen.
Step-by-step wizard values: deploy/stalwart/README.md.
docker compose up --build also runs the app in a container. Prefer pnpm dev:live while developing.
Internet mail
Local live mode creates real mailboxes in Stalwart. It does not receive mail from Gmail or other public servers.
Inbound and outbound on the public internet need Stalwart on a host with usable port 25, a matching PTR record, and a warm IP — or an outbound relay. Set MAIL_HOSTNAME to that public MX host (not mail.example.com). The DNS wizard still checks live DNS over Cloudflare DoH.
An HTTP tunnel does not replace SMTP on port 25.
To put this on Vercel, Railway, Coolify, Openship, or a VPS, see docs/self-hosting.md.
How it fits together
browser → Redakt (Next.js)
│
├── demo: fixtures + .data/demo.json
└── live: Postgres (Better Auth, domains)
Stalwart over JMAP (mail + DNS zone)getMailProvider(user) in lib/mail/get-provider.ts is the switch. Both backends implement MailProvider in lib/mail/provider.ts.
Mail views have canonical, refresh-safe URLs. Authenticated route data is loaded on the server; navigation, search controls, pagination, compose, and the persistent tab rail enhance those pages on the client.
| Route | View |
|---|---|
/mail/:folder | Inbox, unread, sent, drafts, spam, or archived list |
/mail/:folder/thread/:threadId | Conversation in its originating folder context |
/mail/settings/domain | Domain and DNS setup |
Folder query state such as search, filters, and sort order is encoded in the URL, so a copied link and a full reload render the same result.
| Path | Role |
|---|---|
app/ | App Router pages and API routes |
components/shell/ | Login, onboarding, inbox chrome |
components/mail/ | Thread list and reader |
components/ui/ | Shared controls (StyleX + Base UI) |
lib/mail/ | Provider types and routing |
lib/demo/ | Demo store and fixture provider |
lib/stalwart/ | JMAP client and live provider |
theme/ | StyleX tokens |
fixtures/ | Sample .eml files for demo |
deploy/stalwart/ | Stalwart notes and future production config |
docs/self-hosting.md | Vercel, Railway, Coolify, Openship, VPS |
Environment
Copy .env.example to .env. Do not commit .env.
| Variable | Demo | Live |
|---|---|---|
DEMO_MODE | true (default) | false (pnpm dev:live sets this) |
BETTER_AUTH_SECRET | unused | required |
BETTER_AUTH_URL | unused | http://localhost:3000 |
DATABASE_URL | unused | Postgres URL |
STALWART_URL | unused | http://localhost:8080 |
STALWART_ADMIN_USER | unused | wizard admin email after first boot |
STALWART_ADMIN_SECRET | unused | wizard admin password |
MAIL_HOSTNAME | MX host shown in the DNS wizard | same; use your public mail host in production |
Mailbox passwords are at least 8 characters (Better Auth).
Keyboard
⌥N compose, j / k move, ⌘W close tab, r reply, c compose.
Contributing
Issues and pull requests are welcome. See CONTRIBUTING.md and CODE_OF_CONDUCT.md.
License
MIT. Stalwart remains AGPL when you run it.