# Mailflare / Stalwart

Apex mail you run. Mailflare is the Cloudflare Workers mailbox already on the office stack; Stalwart is the all-in-one IMAP/JMAP/SMTP server.

**Replaces:** Gmail

**Tier:** Medium

## Problem

Gmail for work is Google Workspace Business Starter at $7/user/month billed yearly. Consumer Gmail is free and not yours. Mailflare gives you mail and calendar on Workers; Stalwart is a real mail server (IMAP, JMAP, SMTP, CalDAV, CardDAV) you host.

## Stack

- [Mailflare](https://github.com/hieunc229/mailflare) — Email, calendar, and booking on Cloudflare Workers
- [Stalwart](https://stalw.art) — All-in-one mail and collaboration server (IMAP, JMAP, SMTP)

## Estimated SaaS cost saved

| You stop paying | Typical / year | Self-host instead |
|---|---:|---|
| Google Workspace Business Starter (5) | $420 | Mailflare on Workers or Stalwart |
| Workspace + Calendly-style extras | $1,380 | Mailflare office stack if you also need calendar sync |

**About $1,380 / year** on a small team, before you count lock-in.

## Deploy on Railway

Stalwart wants a public IP, MX, and a volume — a VPS or a Railway service with DNS you control. Mailflare stays on Cloudflare (see the Mailflare office stack). Do not put two MX stories on the same hostname.

[Start on Railway](https://c17.io/go/railway/stalwart-mail?from=%2Fstacks%2Fstalwart-mail.md)

## AGENT_PROMPT

```
Replace hosted Gmail with mail you run.

Pick Mailflare (Cloudflare Workers, already documented on the Mailflare office stack) or Stalwart (https://stalw.art) as a full IMAP/JMAP/SMTP server.
- One MX story per hostname. Resend or Stalwart outbound on a send. subdomain if apex MX stays on Mailflare.
- Persist Stalwart data on a volume. Do not expose the admin without auth.
- Write AGENT_PROMPT.md. Point at the Mailflare office stack if they also need calendar + booking.
```

## FAQ

### Mailflare or Stalwart?

Mailflare if you already live on Cloudflare and want mail + calendar + a booking page. Stalwart if you want a classic mail server (IMAP clients, JMAP, CalDAV) on a box you SSH into.

### Is this the office stack?

Related. /replace/google-workspace is the full office (Mailflare + synct + genoffice). This page is Gmail only.

Source: https://c17.io/stacks/stalwart-mail
