CLI tool
beilunyang/moemail avatar
beilunyang/moemail

MoeMail: a temporary email service you can self-host on Cloudflare

A cute temporary email service built with the Next.js + Cloudflare stack.

2,832 stars2,600 forksTypeScriptMIT

At a glance

What is it?
MoeMail is an open source temp email service built on Next.js, Cloudflare Pages, D1 and Email Workers. It is pleasant to deploy and pleasant to use, but it is a Cloudflare-shaped project, not a portable one.
Who is it for?
Adopt MoeMail if you already run Cloudflare and want a disposable inbox with an API key, a CLI and an MCP server attached to it. Do not adopt it if you need a provider-neutral stack or if you cannot route a domain's MX records through Cloudflare Email Routing, because the inbound path has no alternative.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 85 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • beilunyang/moemail2,832 ★ · +8
Star history
Repository2026-10-042026-11-22
beilunyang/moemail2.8k2.8k

8 Stars in the last 49 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What problem MoeMail solves, and who ends up using it

The README frames the problem plainly: protect a real email address from spam and unnecessary subscriptions. That is the standard case for a disposable inbox, and MoeMail answers it with a hosted instance at moemail.app and a self-hostable codebase for people who would rather own the domain. The feature list sets the shape of the product. Mailboxes can be created with a validity of 1 hour, 24 hours, 3 days, or permanent, and expired mailboxes and messages are cleaned up automatically. Receipt is not push-based in the browser; the README describes automatic polling, so the UI learns about a new message on an interval rather than the moment it lands.

The audience is narrower than the feature list suggests. Because the whole thing is built on Cloudflare Pages, Cloudflare D1 and Cloudflare Email Workers, the natural user is someone who already has a Cloudflare account and is comfortable with Wrangler. The README states the project is capable of free self-hosting on Cloudflare, which is the pitch: no VPS, no mail server daemon, no deliverability work of your own. If you are not on Cloudflare, most of the value evaporates.

The Cloudflare-shaped architecture: Pages, D1, KV and Email Workers

MoeMail is not one program. It is at least three deployable pieces plus storage, and the repository layout makes that explicit: there is an app/ directory for the Next.js App Router application, a workers/ directory, and three separate Wrangler config files (wrangler.example.json, wrangler.email.example.json, wrangler.cleanup.example.json). Each example file is meant to be copied to its non-example name, which means an install involves configuring three environments rather than one.

The data flow for an incoming message is the interesting part. Mail arrives for your domain, Cloudflare Email Routing hands it to the email worker defined in wrangler.email.json, and that worker parses the message. The dependency list includes postal-mime, a MIME parser, which is consistent with the worker doing the parsing rather than forwarding raw bytes. Parsed messages land in Cloudflare D1, a SQLite database, accessed through Drizzle ORM with the schema and migrations under drizzle/ and drizzle.config.ts. The Next.js frontend reads from D1 through the same ORM. A separate cleanup worker, deployed from wrangler.cleanup.json, handles expiry on a schedule. Site settings live in a Cloudflare KV namespace, named in the environment file as KV_NAMESPACE_NAME.

That split has a real consequence. The README says the email worker currently cannot be run and tested locally, and tells you to deploy it with Wrangler to test it. So the inbound half of the system is developed against production infrastructure. Everything else has a local path; this piece does not.

Installing MoeMail locally and creating your first mailbox

The README lists Node.js 18+, pnpm, the Wrangler CLI and a Cloudflare account as prerequisites. Start by cloning and installing.

bash
git clone https://github.com/beilunyang/moemail.git
cd moemail
pnpm install

Next, copy the three Wrangler example configs into place. The README says to set the Cloudflare D1 database name and database ID after this step, so expect to edit wrangler.json before anything runs.

bash
cp wrangler.example.json wrangler.json
cp wrangler.email.example.json wrangler.email.json
cp wrangler.cleanup.example.json wrangler.cleanup.json

Environment variables come from .env.example. The README names AUTH_GITHUB_ID, AUTH_GITHUB_SECRET and AUTH_SECRET as the ones to set for a local run, and the example file also carries AUTH_GOOGLE_ID, AUTH_GOOGLE_SECRET, CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID, DATABASE_NAME, KV_NAMESPACE_NAME and CUSTOM_DOMAIN.

bash
cp .env.example .env.local

Create the local D1 schema, then start the dev server. The migrate script takes a local or remote argument, so the same entry point handles both targets.

bash
pnpm db:migrate-local
pnpm dev

If you want data to look at before wiring a real domain, the repository ships a generator. The package script runs it under Wrangler rather than plain Node.

bash
pnpm generate-test-data

What you should see is a Next.js app on its default dev port with a sign-in screen, because authentication is required before a mailbox exists. The README does not document a default local port for the app, so read it from the dev server output. Testing the inbound path is a separate exercise: you deploy the email worker with pnpm deploy:email and send mail to a domain you have routed to it.

Where MoeMail breaks: local email testing, provider lock-in, and shared domains

The clearest limitation is stated by the project itself. The email worker cannot run and be tested locally; you deploy it to Cloudflare to try it. That turns every change to message parsing into a deploy-and-send cycle, and it means a contributor without a Cloudflare account and a mail-routed domain cannot meaningfully work on the most important code path in the product.

Provider lock-in is the second. D1 is SQLite, but the binding, the KV namespace, the Pages deployment target and Email Routing are all Cloudflare services. There is no documented adapter for another host, and the deployment scripts assume Wrangler. If your organisation runs on AWS or on a plain VPS, porting MoeMail means rewriting the storage layer and finding a replacement for inbound email routing, which is the hard half.

Third, a temporary email service inherits the reputation of its domain. If you self-host on a domain that has been used for disposable inboxes before, or on a shared domain, sites that block throwaway addresses will block yours too. MoeMail does not address this, and the README does not claim to. There is a related design point worth flagging: mailboxes can be permanent, which is convenient for a personal alias but is not what most people mean by temporary email, and it shifts the privacy story from automatic expiry to something you manage yourself.

Finally, the permission system is described in the README as role-based access control, but the README section on it is a heading in the table of contents rather than an explanation in the text available here. Treat the exact role model as something to read on docs.moemail.app before you rely on it for a multi-user deployment.

MoeMail compared with running your own mail server

The obvious alternative is a self-hosted mail stack such as Mailcow or Mail-in-a-Box: a real mail server on a VPS with IMAP, SMTP, DKIM and a queue. The difference in approach is total. Those systems give you a general-purpose mail server; you then build disposable-address behaviour on top of catch-all rules and a script. MoeMail inverts that. It is a single-purpose application with no IMAP and no SMTP server of its own: inbound mail is delivered by Cloudflare Email Routing into a worker, and outbound mail goes through Resend, per the README's description of the sending function. You get a web UI, an API key, a CLI and an MCP server out of the box, and you get none of the operational surface of a mail server.

That trade is worth naming. With Mailcow you own deliverability, patching and disk, and you can move the whole thing to another host. With MoeMail you own almost nothing operationally, and you can move almost nothing. The second alternative is simpler still: use the hosted moemail.app instance for one-off signups and never self-host. That is the right call if you do not need a custom domain, because the entire reason to self-host here is to control the address.

The API key, CLI and MCP server: MoeMail as agent infrastructure

The most distinctive part of MoeMail is not the inbox UI. It is that the project ships an OpenAPI surface reachable with an API key, plus two packages released on 2026-06-16: @moemail/cli v1.0.0 and @moemail/mcp v1.0.0. The README describes the CLI as agent-first, designed for AI agents to automate email workflows, and the MCP server as a separate package. A temporary inbox that an agent can create, poll and read is a genuinely different product from a web page you paste into a signup form.

The shape of that workflow matters for how you deploy. The CLI and MCP server talk to an API, so they need a reachable instance and a key, not a local checkout. If your plan is to drive MoeMail from a script or an agent, the hosted instance or a properly deployed self-hosted one is the target, and the local dev server is only for UI work. The README does not document the CLI's subcommands or the MCP server's tool list in the text available here; both are covered on docs.moemail.app.

Licence, maintenance and what an upgrade actually costs

MoeMail is MIT licensed. In practice that means you can use, modify and redistribute it, including in commercial settings, provided the copyright notice and licence text are preserved. It does not grant trademark rights, and it does not come with a warranty. That is a statement about the licence text, not advice about your situation.

Maintenance is the part to look at carefully. The repository is not archived, and the last push was on 2026-08-29, so the project has seen recent activity. The release history is uneven in a useful way: the main application tag v0.15.0 landed on 2025-12-07, while the CLI and MCP packages reached 1.0.0 on 2026-06-16. Reading that pattern, the tooling around the service is where the newer work sits, and the web application itself has been on the 0.15 line for longer.

Upgrade cost is dominated by the three Wrangler configs. Because they are copied from example files, a change to the expected keys or bindings will not merge into your wrangler.json automatically, and D1 schema changes arrive through drizzle/ migrations that you run with pnpm db:migrate-remote. The GitHub Actions path is friendlier here: the README describes tag-triggered and manual deploys driven by repository secrets, including DATABASE_NAME, KV_NAMESPACE_NAME and PROJECT_NAME, which default to moemail-db, moemail-kv and moemail when left empty. If you deploy that way, upgrading is closer to pushing a tag than to reconciling config by hand.

Editorial conclusion

Adopt MoeMail if you already run Cloudflare and want a disposable inbox with an API key, a CLI and an MCP server attached to it. Do not adopt it if you need a provider-neutral stack or if you cannot route a domain's MX records through Cloudflare Email Routing, because the inbound path has no alternative. Before committing, verify three things: that your domain's email routing rules reach the deployed worker, that the D1 database name and ID in wrangler.json match the account you deploy to, and that AUTH_SECRET is a random string rather than a placeholder.

Frequently asked questions

What is MoeMail?

It is an open source temporary email service built with Next.js and Cloudflare, with a hosted instance at moemail.app and a self-hostable codebase. It supports mailboxes with 1 hour, 24 hour, 3 day or permanent validity, and adds an API key, a CLI and an MCP server.

How do I deploy MoeMail on Cloudflare?

The README gives two routes. Locally, copy .env.example to .env, set the environment variables, then run pnpm dlx tsx ./scripts/deploy/index.ts. Alternatively, GitHub Actions deploys on a pushed tag or a manual trigger, using repository secrets such as CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID.

Does MoeMail have an API key?

Yes. The README lists OpenAPI access via API key as a feature, and documents an OpenAPI section on docs.moemail.app. The README does not give the API URL, so it depends on the instance you deploy or the hosted moemail.app service.

Does MoeMail support sending email, not just receiving it?

The README lists a sending function that uses temporary addresses and states it is based on the Resend service. Inbound mail arrives through Cloudflare Email Workers, so the two directions use different providers.

Can I run the MoeMail email worker locally?

No. The README states that the email worker currently cannot be run and tested locally and instructs you to deploy it with Wrangler and test it there. The cleanup worker, by contrast, has local dev and test scripts.

Official sources

  1. beilunyang/moemail on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/beilunyang-moemail.svg)](https://hysenlabs.com/projects/beilunyang-moemail)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/beilunyang-moemail.svg)](https://hysenlabs.com/projects/beilunyang-moemail)

Was this useful?