Skip to content

Guide · Open source

How to use cloudflare_temp_email: deploy your own temp mail

Updated · written with AI from the project's own documentation and checked against our catalogue data

cloudflare_temp_email is an open-source project, licensed under MIT and written in TypeScript, that lets you run a disposable email service on Cloudflare's free tier. It receives mail at temporary addresses on a domain you control, provides a web interface to read it, and can send mail back out. This guide explains what you need before you start, how to get the code, and how the main features fit together so you can decide whether to deploy it.

Cloudflare 临时邮箱dreamhunter2333/cloudflare_temp_email · ★ 12k · MIT

Quick start

  1. 1Check prerequisites. Make sure you have a Cloudflare account, a domain managed through Cloudflare, and Node.js installed.
  2. 2Clone the repository. Run the git clone command for dreamhunter2333/cloudflare_temp_email on your machine.
  3. 3Read the deployment guide. Open the documentation at temp-mail-docs.awsl.uk and choose the manual or GitHub Actions path.
  4. 4Deploy backend and frontend. Deploy the backend to Cloudflare Workers and the frontend to Cloudflare Pages, following the guide.
  5. 5Configure your domain and mail routing. Connect your domain and set up Cloudflare Email Routing so incoming mail reaches the Worker.
  6. 6Test with a temporary address. Create an address, receive a test email and open it in the web interface.

What you need before you start

The project is deployed by you, not sold as a hosted service. The README lists three prerequisites: a Cloudflare account, a domain managed through Cloudflare, and Node.js. The README excerpt does not state which Node.js version is required, so check the full deployment documentation for that.

  • A Cloudflare account
  • A domain managed through Cloudflare
  • Node.js (version not stated in the README excerpt)

Get the source code

The install method is clone-and-build. Clone the repository from GitHub to a folder on your machine using the command below. The README's quick-start section points to the online deployment documentation for the steps that follow.

git clone https://github.com/dreamhunter2333/cloudflare_temp_email

Deploy to Cloudflare

The README links to a deployment guide at temp-mail-docs.awsl.uk and a separate guide for GitHub Actions deployment. It also includes a Deploy to Cloudflare Workers button that points to the GitHub Actions guide. The backend runs on Cloudflare Workers, the frontend on Cloudflare Pages, and the database is Cloudflare D1. Follow those guides for the exact configuration, since the README excerpt does not list the individual steps.

  • Backend: Cloudflare Workers
  • Frontend: Cloudflare Pages
  • Database: Cloudflare D1 (SQLite)
  • Storage: Cloudflare KV and R2, with optional S3

Receive and read mail

Mail routing uses Cloudflare Email Routing. The project supports creating random second-level domain addresses on a base domain you specify, which helps keep mail for different uses separate. Attachments can be viewed in the interface, including images, and attachment storage can use S3.

  • Random subdomain addresses on your base domain
  • Attachment viewing, including image display
  • Spam detection with allow and block lists
  • Global forwarding address for mail forwarding
  • Address passwords for extra protection

Send mail and use SMTP or IMAP

Sending supports DKIM verification and several methods, including SMTP and Resend. The project also includes an SMTP proxy server written in Python, which lets you send mail over SMTP and view mail over IMAP. The README notes that adding Resend domain records can fail if your DNS provider hosts a third-level domain, because the default subdomain prefix must be removed. You can verify MX records with nslookup as shown in the README.

  • Send with DKIM verification
  • Send via SMTP or Resend
  • SMTP proxy server for sending and IMAP for reading
nslookup -qt="mx" a.b.com 1.1.1.1

Manage users, the admin console and the Telegram bot

The project includes user registration and login, OAuth2 login (for example GitHub), Passkey login, and a full admin console for user management and scheduled cleanup. A Telegram Bot with Telegram push notifications lets you manage mail from Telegram. Webhook support and Cloudflare Turnstile verification are also included, along with rate limiting.

  • User registration and login, with mailbox binding
  • OAuth2 login such as GitHub or Authentik
  • Passkey passwordless login
  • Admin console with scheduled cleanup
  • Telegram Bot and push notifications
  • Webhooks and Cloudflare Turnstile verification

What people use it for

  • Receiving sign-up or verification emails without using a personal inbox
  • Catching test emails while developing an app
  • Creating random addresses on your own domain to separate mail streams
  • Reading and managing incoming mail from a Telegram bot
  • Sending mail over SMTP from an app while viewing it over IMAP

Frequently asked questions

Is cloudflare_temp_email free?

The README says it is built on Cloudflare free services and can run at zero cost. The project is licensed under MIT. Your costs depend on your own Cloudflare account and domain usage, which the README does not detail.

What do I need to install cloudflare_temp_email?

You need a Cloudflare account, a domain managed through Cloudflare, and Node.js. The clone command is git clone https://github.com/dreamhunter2333/cloudflare_temp_email, and the deployment guide covers the rest.

Does cloudflare_temp_email work without Cloudflare?

No. The backend runs on Cloudflare Workers, the frontend on Cloudflare Pages, and data is stored in Cloudflare D1. Anyone who cannot use Cloudflare services cannot run this project as documented.

Can I use cloudflare_temp_email with a Telegram bot?

Yes. The project includes a full Telegram Bot with Telegram push notifications and a Telegram Bot mini program. You set it up as part of your deployment.

How is cloudflare_temp_email different from Cloudflare Email Routing?

Cloudflare Email Routing is the official forwarding service, and this project uses it for mail routing. cloudflare_temp_email adds a web interface, temporary addresses, user accounts, an admin console and a Telegram bot on top.

How does it compare to Temp Mail or Mailinator?

Temp Mail and Mailinator are ready-made disposable email services that need no setup. cloudflare_temp_email must be deployed by you on your own domain, so it suits people who want private control, while the others suit people who want no setup.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Choose cloudflare_temp_email if you want a private disposable inbox on your own domain, you have a Cloudflare account, and you are comfortable following a deployment guide. Pick a ready-made service like Temp Mail or Mailinator if you want to start immediately, and avoid this project if you need guaranteed enterprise mail delivery, since the README makes no delivery guarantees.

Install options & downloads