Running Your Own Email
Running email is several jobs, and you don’t have to do all of them yourself. This page helps you decide which parts to self-host, which to rent, and what you need before you start. The pages linked at the end cover each part in depth.
What “running email” means
Section titled “What “running email” means”| Job | What it involves | Can you rent it? |
|---|---|---|
| Receiving (the MX) | Accepting mail from the internet on port 25, filtering spam and malware | Yes: a hosted provider, or Cloudflare Email Routing for forwarding |
| Mailboxes | Storing mail, IMAP for clients, quotas, backups | Yes: any hosted provider with custom domains |
| Sending with a reputation | Getting your outgoing mail accepted by Gmail and Microsoft | Yes: a smarthost relay such as Brevo or Amazon SES |
| Webmail and clients | Roundcube or SOGo, app passwords, autoconfig | Comes with the mailbox host |
| App mail | Password resets, invites, reminders and server alerts | Yes: Cloudflare Email Sending, Brevo, SES, Postmark |
The hardest of these is sending. Receiving and storing mail is mostly a software problem, while getting mail delivered depends on your IP address’s reputation and DNS records that only your provider or registrar can set.
Before you start
Section titled “Before you start”Check these before you pick software. Each of them has stopped a self-hosted mail server in practice.
- A static public IP that you’ll keep for years. Changing it resets your sending reputation.
- Port 25 open in both directions. Many residential ISPs and cloud providers block outbound 25 by default. Without outbound 25 you can still receive mail, but you must send through a relay.
- A reverse DNS (PTR) record you can set, matching the name your server announces in its SMTP greeting (forward-confirmed reverse DNS). Your ISP or hosting provider controls the PTR zone, not your DNS host. Without a PTR, large receivers reject direct mail, and Spamhaus lists many residential and business ranges on its Policy Block List.
- An IP that isn’t already listed. Check it at check.spamhaus.org before you build anything.
- A server with enough memory. mailcow needs at least 6 GiB of RAM plus 1 GiB of swap. Lighter servers exist; see the comparison on the mailcow page.
- Time to operate it. Expect security patches within days (webmail is a frequent target), monitoring, certificate renewals and tested backups. Mail that silently stops arriving is worse than mail you never hosted.
Choose a model
Section titled “Choose a model”| Model | You run | You rent | Good for | Main cost |
|---|---|---|---|---|
| 1. Forwarding only | Nothing | Cloudflare Email Routing (free) | info@yourdomain forwarded to personal inboxes | Replies come from the personal address |
| 2. Hosted mailboxes | DNS records | Proton, Fastmail, Google Workspace, iCloud custom domains | Organizations without an operator | Per-user subscription |
| 3. Hybrid | Mailboxes, receiving, webmail | A smarthost for outbound | Self-hosting without a PTR or a warm IP | Relay plan; one more provider to authenticate |
| 4. Fully self-hosted | Everything, including direct delivery | Nothing | Operators with a PTR, a clean IP and time | Reputation building and monitoring |
| 5. App mail only | Your apps | Cloudflare Email Sending, Brevo, SES or Postmark | Transactional mail from websites and servers | Abuse prevention in your app |
Models 3 and 5 combine well, and that is what IrregularChat runs.
flowchart TD
A[Do people need mailboxes at your domain?] -->|No, just forwarding| F[Model 1: Cloudflare Email Routing]
A -->|Yes| B[Is there someone to operate a mail server?]
B -->|No| H[Model 2: hosted mailboxes]
B -->|Yes| C[Can you set a PTR record on a clean static IP, with outbound port 25?]
C -->|No| Y[Model 3: self-hosted mailboxes + smarthost]
C -->|Yes| Z[Model 4: fully self-hosted, or model 3 while the IP warms up]
A2[Do your apps send mail?] -->|Yes| P[Model 5: app mail from a dedicated subdomain]
Notes on each model
Section titled “Notes on each model”- Forwarding only. Email Routing takes over the domain’s MX, so it can’t run alongside your own mail server on the same name. It’s free and needs no server. See App and Transactional Email.
- Hosted mailboxes. The least work. You still own the DNS records (SPF, DKIM, DMARC), and they still need care when you add a sending service.
- Hybrid. Your server receives and stores mail; every outgoing message goes through a relay with an established reputation. You don’t need a PTR, and the relay handles reputation. DMARC passes on your DKIM signature, because the relay uses its own bounce address. See DNS Authentication.
- Fully self-hosted. Possible with a PTR, a clean IP and patience: start with low volume, watch the reports, and expect a few weeks before large receivers trust the IP.
- App mail. Send it from a subdomain such as
mail.example.org, so its reputation and DMARC policy are separate from people’s mail. The main risk is your own app being abused to send spam; see the abuse rules on the app-mail page.
Domains that don’t send mail
Section titled “Domains that don’t send mail”Every domain you own can be spoofed, including parked ones. A domain that will never send or receive mail should publish a null MX, an SPF record that allows nothing, and a DMARC reject policy. The records are on the DNS Authentication page. Remove them before the domain starts using mail.
Worked example: how IrregularChat runs email
Section titled “Worked example: how IrregularChat runs email”The community runs model 3 for people’s mail and model 5 for app mail.
flowchart LR
subgraph People
C[Mail clients and Roundcube]
end
subgraph Self-hosted
M[mailcow: irregulars.io mailboxes]
R[Roundcube webmail]
S[SimpleLogin: simplymail.org aliases]
end
subgraph Rented
B[Amazon SES smarthost]
CF[Cloudflare Email Sending: mail.irregulars.io]
end
Internet((Internet)) -->|MX| M
Internet -->|MX| S
S -->|alias owner on irregulars.io| M
S -->|alias owner elsewhere| B
C --> R --> M
C -->|submission| M
M -->|all outbound| B --> Internet
W[Workers and GitLab] --> CF --> Internet
| Part | What we use | Why |
|---|---|---|
Mailboxes and receiving for irregulars.io | mailcow | Delegated domain admins, so partner organizations can be hosted as separate tenants. Bundles Rspamd, ClamAV and SOGo. |
| Outbound | Amazon SES smarthost (since 2026-10-20) | Our mail IPs have no PTR record and sit on Spamhaus’s policy list, so direct delivery was rejected. We used Brevo until we found it adding tracking to the HTML mail it relayed; SES passes messages through unmodified (tested). See smarthost or direct? |
| Webmail | Roundcube at mail.irregulars.io | Fast and familiar. Published through a Cloudflare Tunnel; mail ports are not. |
| Aliases | SimpleLogin on simplymail.org | Members can hand out an alias instead of their real address. |
| App mail | Cloudflare Email Sending on mail.irregulars.io | Workers send through the send_email binding; GitLab uses the SMTP endpoint. A separate subdomain keeps app reputation apart. |
| Transport security | MTA-STS (testing mode) and TLS-RPT | The MTA-STS policy file is served by a Cloudflare Worker. |
| Reporting | DMARC aggregate reports | Published on every zone, including parked ones. |
The detailed setup, and the lessons from two migrations, are on the mailcow page and the SimpleLogin page.
Where to go next
Section titled “Where to go next”- DNS Authentication: MX, PTR, SPF, DKIM, DMARC, MTA-STS and TLS-RPT, with the mistakes to avoid.
- Self-Hosted Mail Server: mailcow: the runbook, the server comparison and the lessons learned.
- Self-Hosted SimpleLogin: an alias service on your own domain.
- App and Transactional Email: Cloudflare Email Routing and Email Sending, Brevo, and keeping your app from becoming a spam relay.
- Email Deliverability: what to check before sending, after every change, and every day.
Related
Section titled “Related”- Email Hardening Guide: choosing a provider and protecting your own account.
- Email Anonymity Guide: aliases and compartmentalization.
- Cloudflare
- Self-Host Cloudflare Tunnels
- Backups with Restic