# Technical Documentation: dreamhunter2333/cloudflare_temp_email
> ℹ️ **Provenance:** Hybrid Fusion: `dreamhunter2333/cloudflare_temp_email` (README + 8 In-Tree Chapters) · [CodeWiki Reference](https://codewiki.google/github.com/dreamhunter2333/cloudflare_temp_email) · Recency: Active (< 180 days)
## 1. Project Overview & Quickstart (dreamhunter2333/cloudflare_temp_email)
# Cloudflare 临时邮箱 - 免费搭建临时邮件服务
> 本项目仅供学习和个人用途,请勿将其用于任何违法行为,否则后果自负。
**一个功能完整的临时邮箱服务!**
- **完全免费** - 基于 Cloudflare 免费服务构建,零成本运行
- **高性能** - Rust WASM 邮件解析,响应速度极快
- **现代化界面** - 响应式设计,支持多语言,操作简便
- **地址密码** - 支持为邮箱地址设置独立密码,增强安全性
- **Agent 友好** - 内置邮箱 [`skill`](skills/cf-temp-mail-agent-mail/SKILL.md),方便 AI agent 使用邮箱
- **移动端管理** - 社区客户端 [CloudMail](https://github.com/Lur1N77777/CloudMail),支持 Android 管理后台和邮箱管理
## 部署文档 - 快速开始
[部署文档](https://temp-mail-docs.awsl.uk) | [Github Action 部署文档](https://temp-mail-docs.awsl.uk/zh/guide/actions/github-action.html)
## 更新日志
查看 [CHANGELOG](CHANGELOG.md) 了解最新更新内容。
## 在线体验
立即体验 → [https://mail.awsl.uk/](https://mail.awsl.uk/)
服务状态监控(点击收缩/展开)
| | |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Backend](https://temp-email-api.awsl.uk/) | [](https://github.com/dreamhunter2333/cloudflare_temp_email/actions/workflows/backend_deploy.yaml) |
| [Frontend](https://mail.awsl.uk/) | [](https://github.com/dreamhunter2333/cloudflare_temp_email/actions/workflows/frontend_deploy.yaml) |
Star History(点击收缩/展开)
目录(点击收缩/展开)
- [Cloudflare 临时邮箱 - 免费搭建临时邮件服务](#cloudflare-临时邮箱---免费搭建临时邮件服务)
- [部署文档 - 快速开始](#部署文档---快速开始)
- [更新日志](#更新日志)
- [在线体验](#在线体验)
- [核心功能](#核心功能)
- [邮件处理](#邮件处理)
- [用户管理](#用户管理)
- [管理功能](#管理功能)
- [多语言与界面](#多语言与界面)
- [集成与扩展](#集成与扩展)
- [技术架构](#技术架构)
- [系统架构](#系统架构)
- [技术栈](#技术栈)
- [主要组件](#主要组件)
- [加入社区](#加入社区)
## 核心功能
核心功能详情(点击收缩/展开)
### 邮件处理
- [x] 使用 `rust wasm` 解析邮件,解析速度快,几乎所有邮件都能解析,node 的解析模块解析邮件失败的邮件,rust wasm 也能解析成功
- [x] **AI 邮件识别** - 使用 Cloudflare Workers AI 自动提取邮件中的验证码、认证链接、服务链接等重要信息
- [x] 支持为指定基础域名创建随机二级域名邮箱地址,更适合收件隔离场景
- [x] 支持发送邮件,支持 `DKIM` 验证
- [x] 支持 `SMTP` 和 `Resend` 等多种发送方式
- [x] 增加查看 `附件` 功能,支持附件图片显示
- [x] 支持 S3 附件存储和删除功能
- [x] 垃圾邮件检测和黑白名单配置
- [x] 邮件转发功能,支持全局转发地址
### 用户管理
- [x] 使用 `凭证` 重新登录之前的邮箱
- [x] 添加完整的用户注册登录功能,可绑定邮箱地址,绑定后可自动获取邮箱JWT凭证切换不同邮箱
- [x] 支持 `OAuth2` 第三方登录(Github、Authentik 等)
- [x] 支持 `Passkey` 无密码登录
- [x] 用户角色管理,支持多角色域名和前缀配置
- [x] 用户收件箱查看,支持地址和关键词过滤
### 管理功能
- [x] 完整的 admin 控制台
- [x] `admin` 后台创建无前缀邮箱
- [x] admin 用户管理页面,增加用户地址查看功能
- [x] 定时清理功能,支持多种清理策略
- [x] 获取自定义名字的邮箱,`admin` 可配置黑名单
- [x] 增加访问密码,可作为私人站点
### 多语言与界面
- [x] 前后台均支持多语言
- [x] 现代化 UI 设计,支持响应式布局
- [x] 支持 Google Ads 集成
- [x] 使用 shadow DOM 防止样式污染
- [x] 支持 URL JWT 参数自动登录
### 集成与扩展
- [x] 完整的 `Telegram Bot` 支持,以及 `Telegram` 推送,Telegram Bot 小程序
- [x] 添加 `SMTP proxy server`,支持 `SMTP` 发送邮件,`IMAP` 查看邮件
- [x] Webhook 支持,消息推送集成
- [x] 支持 `CF Turnstile` 人机验证
- [x] 限流配置,防止滥用
- [x] **Agent 友好**:内置 [`cf-temp-mail-agent-mail`](skills/cf-temp-mail-agent-mail/SKILL.md) skill,AI agent 可直接消费邮箱,详见 [文档](vitepress-docs/docs/zh/guide/feature/agent-email.md)
- [x] 社区移动端管理客户端:[CloudMail](https://github.com/Lur1N77777/CloudMail) 基于 Expo / React Native,面向本项目兼容 API,提供 Android 管理员后台、地址管理、收件/发件/未知邮件、验证码快捷复制、OLED 黑主题和本地分组。
## 技术架构
技术架构详情(点击收缩/展开)
### 系统架构
- **数据库**: Cloudflare D1 作为主数据库
- **前端部署**: 使用 Cloudflare Pages 部署前端
- **后端部署**: 使用 Cloudflare Workers 部署后端
- **邮件转发**: 使用 Cloudflare Email Routing
### 技术栈
- **前端**: Vue 3 + Vite + TypeScript
- **后端**: TypeScript + Cloudflare Workers
- **邮件解析**: Rust WASM (mail-parser-wasm)
- **数据库**: Cloudflare D1 (SQLite)
- **存储**: Cloudflare KV + R2 (可选 S3)
- **代理服务**: Python SMTP/IMAP Proxy Server
### 主要组件
- **Worker**: 核心后端服务
- **Frontend**: Vue 3 用户界面
- **Mail Parser WASM**: Rust 邮件解析模块
- **SMTP Proxy Server**: Python 邮件代理服务
- **Pages Functions**: Cloudflare Pages 中间件
- **Documentation**: VitePress 文档站点
### 提醒
- 在Resend添加域名记录时,如果您域名解析服务商正在托管您的3级域名a.b.com,请删除Resend生成的默认name中二级域名前缀b,否则将会添加a.b.b.com,导致验证失败。添加记录后,可通过
```bash
nslookup -qt="mx" a.b.com 1.1.1.1
```
进行验证。
## 加入社区
- [Telegram](https://t.me/cloudflare_temp_email)
## 2. In-Tree Documentation Chapters (dreamhunter2333/cloudflare_temp_email)
## File: README.md
# Cloudflare 临时邮箱 - 免费搭建临时邮件服务
> 本项目仅供学习和个人用途,请勿将其用于任何违法行为,否则后果自负。
**一个功能完整的临时邮箱服务!**
- **完全免费** - 基于 Cloudflare 免费服务构建,零成本运行
- **高性能** - Rust WASM 邮件解析,响应速度极快
- **现代化界面** - 响应式设计,支持多语言,操作简便
- **地址密码** - 支持为邮箱地址设置独立密码,增强安全性
- **Agent 友好** - 内置邮箱 [`skill`](skills/cf-temp-mail-agent-mail/SKILL.md),方便 AI agent 使用邮箱
- **移动端管理** - 社区客户端 [CloudMail](https://github.com/Lur1N77777/CloudMail),支持 Android 管理后台和邮箱管理
## 部署文档 - 快速开始
[部署文档](https://temp-mail-docs.awsl.uk) | [Github Action 部署文档](https://temp-mail-docs.awsl.uk/zh/guide/actions/github-action.html)
## 更新日志
查看 [CHANGELOG](CHANGELOG.md) 了解最新更新内容。
## 在线体验
立即体验 → [https://mail.awsl.uk/](https://mail.awsl.uk/)
服务状态监控(点击收缩/展开)
| | |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Backend](https://temp-email-api.awsl.uk/) | [](https://github.com/dreamhunter2333/cloudflare_temp_email/actions/workflows/backend_deploy.yaml) |
| [Frontend](https://mail.awsl.uk/) | [](https://github.com/dreamhunter2333/cloudflare_temp_email/actions/workflows/frontend_deploy.yaml) |
Star History(点击收缩/展开)
目录(点击收缩/展开)
- [Cloudflare 临时邮箱 - 免费搭建临时邮件服务](#cloudflare-临时邮箱---免费搭建临时邮件服务)
- [部署文档 - 快速开始](#部署文档---快速开始)
- [更新日志](#更新日志)
- [在线体验](#在线体验)
- [核心功能](#核心功能)
- [邮件处理](#邮件处理)
- [用户管理](#用户管理)
- [管理功能](#管理功能)
- [多语言与界面](#多语言与界面)
- [集成与扩展](#集成与扩展)
- [技术架构](#技术架构)
- [系统架构](#系统架构)
- [技术栈](#技术栈)
- [主要组件](#主要组件)
- [加入社区](#加入社区)
## 核心功能
核心功能详情(点击收缩/展开)
### 邮件处理
- [x] 使用 `rust wasm` 解析邮件,解析速度快,几乎所有邮件都能解析,node 的解析模块解析邮件失败的邮件,rust wasm 也能解析成功
- [x] **AI 邮件识别** - 使用 Cloudflare Workers AI 自动提取邮件中的验证码、认证链接、服务链接等重要信息
- [x] 支持为指定基础域名创建随机二级域名邮箱地址,更适合收件隔离场景
- [x] 支持发送邮件,支持 `DKIM` 验证
- [x] 支持 `SMTP` 和 `Resend` 等多种发送方式
- [x] 增加查看 `附件` 功能,支持附件图片显示
- [x] 支持 S3 附件存储和删除功能
- [x] 垃圾邮件检测和黑白名单配置
- [x] 邮件转发功能,支持全局转发地址
### 用户管理
- [x] 使用 `凭证` 重新登录之前的邮箱
- [x] 添加完整的用户注册登录功能,可绑定邮箱地址,绑定后可自动获取邮箱JWT凭证切换不同邮箱
- [x] 支持 `OAuth2` 第三方登录(Github、Authentik 等)
- [x] 支持 `Passkey` 无密码登录
- [x] 用户角色管理,支持多角色域名和前缀配置
- [x] 用户收件箱查看,支持地址和关键词过滤
### 管理功能
- [x] 完整的 admin 控制台
- [x] `admin` 后台创建无前缀邮箱
- [x] admin 用户管理页面,增加用户地址查看功能
- [x] 定时清理功能,支持多种清理策略
- [x] 获取自定义名字的邮箱,`admin` 可配置黑名单
- [x] 增加访问密码,可作为私人站点
### 多语言与界面
- [x] 前后台均支持多语言
- [x] 现代化 UI 设计,支持响应式布局
- [x] 支持 Google Ads 集成
- [x] 使用 shadow DOM 防止样式污染
- [x] 支持 URL JWT 参数自动登录
### 集成与扩展
- [x] 完整的 `Telegram Bot` 支持,以及 `Telegram` 推送,Telegram Bot 小程序
- [x] 添加 `SMTP proxy server`,支持 `SMTP` 发送邮件,`IMAP` 查看邮件
- [x] Webhook 支持,消息推送集成
- [x] 支持 `CF Turnstile` 人机验证
- [x] 限流配置,防止滥用
- [x] **Agent 友好**:内置 [`cf-temp-mail-agent-mail`](skills/cf-temp-mail-agent-mail/SKILL.md) skill,AI agent 可直接消费邮箱,详见 [文档](vitepress-docs/docs/zh/guide/feature/agent-email.md)
- [x] 社区移动端管理客户端:[CloudMail](https://github.com/Lur1N77777/CloudMail) 基于 Expo / React Native,面向本项目兼容 API,提供 Android 管理员后台、地址管理、收件/发件/未知邮件、验证码快捷复制、OLED 黑主题和本地分组。
## 技术架构
技术架构详情(点击收缩/展开)
### 系统架构
- **数据库**: Cloudflare D1 作为主数据库
- **前端部署**: 使用 Cloudflare Pages 部署前端
- **后端部署**: 使用 Cloudflare Workers 部署后端
- **邮件转发**: 使用 Cloudflare Email Routing
### 技术栈
- **前端**: Vue 3 + Vite + TypeScript
- **后端**: TypeScript + Cloudflare Workers
- **邮件解析**: Rust WASM (mail-parser-wasm)
- **数据库**: Cloudflare D1 (SQLite)
- **存储**: Cloudflare KV + R2 (可选 S3)
- **代理服务**: Python SMTP/IMAP Proxy Server
### 主要组件
- **Worker**: 核心后端服务
- **Frontend**: Vue 3 用户界面
- **Mail Parser WASM**: Rust 邮件解析模块
- **SMTP Proxy Server**: Python 邮件代理服务
- **Pages Functions**: Cloudflare Pages 中间件
- **Documentation**: VitePress 文档站点
### 提醒
- 在Resend添加域名记录时,如果您域名解析服务商正在托管您的3级域名a.b.com,请删除Resend生成的默认name中二级域名前缀b,否则将会添加a.b.b.com,导致验证失败。添加记录后,可通过
```bash
nslookup -qt="mx" a.b.com 1.1.1.1
```
进行验证。
## 加入社区
- [Telegram](https://t.me/cloudflare_temp_email)
---
## File: frontend/README.md
# cloudflare_temp_email
This template should help get you started developing with Vue 3 in Vite.
## Recommended IDE Setup
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
## Customize configuration
See [Vite Configuration Reference](https://vitejs.dev/config/).
## Project Setup
```sh
npm install
```
### Compile and Hot-Reload for Development
```sh
npm run dev
```
### Compile and Minify for Production
```sh
npm run build
```
---
## File: mail-parser-wasm/README.md
# mail-parser-wasm web and cf worker
## [mail-parser-wasm](https://www.npmjs.com/package/mail-parser-wasm)
### mail-parser-wasm usage
```bash
pnpm add mail-parser-wasm
```
```js
import { parse_message } from 'mail-parser-wasm'
const parsedEmail = parse_message(rawEmail);
```
### mail-parser-wasm build
```bash
wasm-pack build --release
wasm-pack publish
```
## [mail-parser-wasm-worker](https://www.npmjs.com/package/mail-parser-wasm-worker)
### mail-parser-wasm-worker usage
```bash
pnpm add mail-parser-wasm-worker
```
```js
import { parse_message_wrapper } from 'mail-parser-wasm-worker'
const parsedEmail = parse_message_wrapper(rawEmail);
```
### mail-parser-wasm-worker build
```bash
wasm-pack build --out-dir web --target web --release
find web/ -type f ! -name '*.json' ! -name '.gitignore' -exec cp {} worker/ \;
# modify worker/package.json version or whatever
pnpm publish worker --no-git-checks
```
---
## File: vitepress-docs/docs/en/cli.md
# cloudflare temp email
This is a temporary email service that uses Cloudflare Workers to create a temporary email address and view the received email in web browser.
## Features
- [x] Cloudflare D1 as a database
- [x] Deploy the front end with Cloudflare Pages
- [x] Deploy the backend with Cloudflare Workers
- [x] Email forwarding using Cloudflare Email Routing
- [x] Use password to login to the previous mailbox again.
- [x] Get Custom Name Email
- [x] Support multiple languages
- [x] Add access authorization, which can be used as a private site
- [x] Add auto reply feature
- [x] Add attachment viewing function
- [x] use rust wasm to parse email
- [x] support send email
- [x] support DKIM
## Deploy
[Install/Update Wrangler](https://developers.cloudflare.com/workers/wrangler/install-and-update/)
```bash
npm install wrangler -g
git clone https://github.com/dreamhunter2333/cloudflare_temp_email.git
# Switch to the latest tag or the branch you want to deploy. You can also use the main branch directly.
# git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
```
## DB - Cloudflare D1
```bash
# create a database, and copy the output to wrangler.toml in the next step
wrangler d1 create temp-email-db
wrangler d1 execute temp-email-db --file=db/schema.sql --remote
# schema update, if you have initialized the database before this date, you can execute this command to update
# wrangler d1 execute temp-email-db --file=db/2024-01-13-patch.sql --remote
# wrangler d1 execute temp-email-db --file=db/2024-04-03-patch.sql --remote
# create a namespace, and copy the output to wrangler.toml in the next step
wrangler kv:namespace create DEV
```
Use a D1 database name such as `temp-email-db` or `cloudflare-temp-email-prod`.
### Backend - Cloudflare workers
The first deployment will prompt you to create a project. Please fill in `production` for the `production` branch.
```bash
cd worker
pnpm install
cp wrangler.toml.template wrangler.toml
# deploy
pnpm run deploy
```
`wrangler.toml`
```
/* Detailed source-code truncated for AI context efficiency. */
```
you can find and test the worker's url in the workers dashboard
## Cloudflare Email Routing
Before you can bind an email address to your Worker, you need to enable Email Routing and have at least one verified email address.
enable email route and config email forward catch-all to the worker
### Frontend - Cloudflare pages
The first deployment will prompt you to create a project. Please fill in `production` for the `production` branch.
```bash
cd frontend
pnpm install
# add .env.local and modify VITE_API_BASE to your worker's url
# VITE_API_BASE=https://xxx.xxx.workers.dev - don't put / in the end
cp .env.example .env.local
pnpm build --emptyOutDir
pnpm run deploy
```
---
## File: vitepress-docs/docs/en/index.md
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home
hero:
name: "Temporary Email Docs"
tagline: "Build Free CloudFlare Temporary Domain Email with Send & Receive"
actions:
- theme: brand
text: Try it now
link: https://mail.awsl.uk/
- theme: alt
text: CLI Deployment
link: /en/guide/quick-start
- theme: alt
text: Deploy via UI
link: /en/guide/quick-start
- theme: alt
text: Deploy via Github Actions
link: /en/guide/quick-start
features:
- title: Private deployment with only a domain name, free hosting on CloudFlare, no server required
details: Support password login for mailboxes, user registration, access password for private sites, attachment support.
- title: Email parsing using Rust WASM
details: Parse emails with Rust WASM, support various RFC email standards, support attachments, extremely fast
- title: Telegram Bot and Webhook support
details: Forward emails to Telegram or webhook, Telegram Bot supports mailbox binding, view emails, Telegram Mini App
- title: Send emails (UI/API/SMTP)
details: Send txt or html emails via domain mailboxes, DKIM signature support, send via UI/API/SMTP
---
---
## File: vitepress-docs/docs/index.md
---
layout: page
---
---
## File: vitepress-docs/docs/reference.md
# Reference
- https://developers.cloudflare.com/d1/
- https://developers.cloudflare.com/pages/
- https://developers.cloudflare.com/workers/
- https://developers.cloudflare.com/email-routing/
---
## File: vitepress-docs/docs/status.md
# Status Page
[Status Link](https://uptime.aks.awsl.icu/status/temp-email)
| Service | Status |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Backend](https://temp-email-api.awsl.uk/) | |
| [Frontend](https://mail.awsl.uk/) | |
--- METRICS ---
- Files Extracted: 9
- Estimated Token Budget: ~4337 tokens
- Recency Window: Active (< 180 days)
- Canonical Reference: https://codewiki.google/github.com/dreamhunter2333/cloudflare_temp_email