Skip to content

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.

JobWhat it involvesCan you rent it?
Receiving (the MX)Accepting mail from the internet on port 25, filtering spam and malwareYes: a hosted provider, or Cloudflare Email Routing for forwarding
MailboxesStoring mail, IMAP for clients, quotas, backupsYes: any hosted provider with custom domains
Sending with a reputationGetting your outgoing mail accepted by Gmail and MicrosoftYes: a smarthost relay such as Brevo or Amazon SES
Webmail and clientsRoundcube or SOGo, app passwords, autoconfigComes with the mailbox host
App mailPassword resets, invites, reminders and server alertsYes: 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.

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.
ModelYou runYou rentGood forMain cost
1. Forwarding onlyNothingCloudflare Email Routing (free)info@yourdomain forwarded to personal inboxesReplies come from the personal address
2. Hosted mailboxesDNS recordsProton, Fastmail, Google Workspace, iCloud custom domainsOrganizations without an operatorPer-user subscription
3. HybridMailboxes, receiving, webmailA smarthost for outboundSelf-hosting without a PTR or a warm IPRelay plan; one more provider to authenticate
4. Fully self-hostedEverything, including direct deliveryNothingOperators with a PTR, a clean IP and timeReputation building and monitoring
5. App mail onlyYour appsCloudflare Email Sending, Brevo, SES or PostmarkTransactional mail from websites and serversAbuse 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]
  • 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.

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
PartWhat we useWhy
Mailboxes and receiving for irregulars.iomailcowDelegated domain admins, so partner organizations can be hosted as separate tenants. Bundles Rspamd, ClamAV and SOGo.
OutboundAmazon 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?
WebmailRoundcube at mail.irregulars.ioFast and familiar. Published through a Cloudflare Tunnel; mail ports are not.
AliasesSimpleLogin on simplymail.orgMembers can hand out an alias instead of their real address.
App mailCloudflare Email Sending on mail.irregulars.ioWorkers send through the send_email binding; GitLab uses the SMTP endpoint. A separate subdomain keeps app reputation apart.
Transport securityMTA-STS (testing mode) and TLS-RPTThe MTA-STS policy file is served by a Cloudflare Worker.
ReportingDMARC aggregate reportsPublished on every zone, including parked ones.

The detailed setup, and the lessons from two migrations, are on the mailcow page and the SimpleLogin page.

  1. DNS Authentication: MX, PTR, SPF, DKIM, DMARC, MTA-STS and TLS-RPT, with the mistakes to avoid.
  2. Self-Hosted Mail Server: mailcow: the runbook, the server comparison and the lessons learned.
  3. Self-Hosted SimpleLogin: an alias service on your own domain.
  4. App and Transactional Email: Cloudflare Email Routing and Email Sending, Brevo, and keeping your app from becoming a spam relay.
  5. Email Deliverability: what to check before sending, after every change, and every day.

Recent changes

  1. docs: record the move from Brevo to Amazon SES for outbound mail gitayam
  2. docs(wiki): add smarthost-vs-direct guidance and two mail server lessons gitayam
  3. docs(wiki): reorganize the email guides for self-hosters gitayam