cloud-mail Documentation

A Cloudflare-based email service | 基于 Cloudflare 的邮箱服务 | Cloudflare Email 邮箱 Mail

13,125 stars JavaScript JavaScript 1 file · ~2,162 tokens #cloudflare#cloudflare-email#cloudflare-workers#email#mail
RAW Doc

File: README.md

项目简介

只需要一个域名,就可以创建多个不同的邮箱,类似各大邮箱平台,本项目支持署到 Cloudflare Workers ,降低服务器成本,搭建自己的邮箱服务

项目展示

功能介绍

  • 💰 低成本使用: 可部署到 Cloudflare Workers 降低服务器成本

  • 💻 响应式设计:响应式布局自动适配PC和大部分手机端浏览器

  • 📧 邮件发送:集成Resend发送邮件,支持群发,内嵌图片和附件发送,发送状态查看

  • 🛡️ 管理员功能:可以对用户,邮件进行管理,RABC权限控制对功能及使用资源限制

  • 📦 附件收发:支持收发附件,使用R2对象存储保存和下载文件

  • 🔔 邮件推送:接收邮件后可以转发到TG机器人或其他服务商邮箱

  • 📡 开放API:支持使用API批量生成用户,多条件查询邮件

  • 🔢 验证码识别:使用Workers AI,自动识别邮件验证码

  • 📈 数据可视化:使用ECharts对系统数据详情,用户邮件增长可视化显示

  • 🎨 个性化设置:可以自定义网站标题,登录背景,透明度

  • 🤖 人机验证:集成Turnstile人机验证,防止人机批量注册

  • 📜 更多功能:正在开发中...

技术栈

目录结构

text
cloud-mail
├── mail-worker				    # worker后端项目
│   ├── src                  
│   │   ├── api	 			    # api接口层			
│   │   ├── const  			    # 项目常量
│   │   ├── dao                 # 数据访问层
│   │   ├── email			    # 邮件处理接收
│   │   ├── entity			    # 数据库实体
│   │   ├── error			    # 自定义异常
│   │   ├── hono			    # web框架配置、拦截器、全局异常等
│   │   ├── i18n			    # 语言国际化
│   │   ├── init			    # 数据库缓存初始化
│   │   ├── model			    # 响应体数据封装
│   │   ├── security			# 身份权限认证
│   │   ├── service			    # 业务服务层
│   │   ├── template			# 消息模板
│   │   ├── utils			    # 工具类
│   │   └── index.js			# 入口文件
│   ├── pageckge.json			# 项目依赖
│   └── wrangler.toml			# 项目配置
│
├── mail-vue				    # vue前端项目
│   ├── src
│   │   ├── axios 			    # axios配置
│   │   ├── components			# 自定义组件
│   │   ├── echarts			    # echarts组件导入
│   │   ├── i18n			    # 语言国际化
│   │   ├── init			    # 入站初始化
│   │   ├── layout			    # 主体布局组件
│   │   ├── perm			    # 权限认证
│   │   ├── request			    # api接口
│   │   ├── router			    # 路由配置
│   │   ├── store			    # 全局状态管理
│   │   ├── utils			    # 工具类
│   │   ├── views			    # 页面组件
│   │   ├── app.vue			    # 入口组件
│   │   ├── main.js			    # 入口js
│   │   └── style.css			# 全局css
│   ├── package.json			# 项目依赖
└── └── env.release				# 项目配置

赞助

许可证

本项目采用 MIT 许可证

交流

Telegram


File: doc/github-action.md

Github Action 部署

配置 Github 仓库

  1. Fork 或克隆仓库 https://github.com/eoao/cloud-mail
  2. 进入您的 GitHub 仓库设置
  3. 转到 Settings → Secrets and variables → Actions → New Repository secrets
  4. 添加以下 Secrets:
Secret 名称 必需 用途
CLOUDFLARE_API_TOKEN ✅ Cloudflare API 令牌(需要 Workers 和相关资源权限)
CLOUDFLARE_ACCOUNT_ID ✅ Cloudflare 账户 ID
D1_DATABASE_ID ✅ 您的 D1 数据库的 ID
KV_NAMESPACE_ID ✅ 您的 KV 命名空间的 ID
R2_BUCKET_NAME ✅ 您的 R2 存储桶的名称
DOMAIN ✅ 您要用于邮件服务的域名(例如 ["xx.xx"],多域名用,分隔)
ADMIN ✅ 您的管理员邮箱地址(例如 [email protected])
JWT_SECRET ✅ 用于生成和验证 JWT 的随机长字符串
INIT_URL ❌ (可选)部署后用于初始化数据库的 Worker URL(格式参考下述手动初始化)

获取 Cloudflare API 令牌

  1. 访问 Cloudflare Dashboard

  2. 创建新的 API 令牌

  3. 选择"编辑 Cloudflare Workers"模板,并参照下表添加相应权限

  4. 保存令牌并复制到 GitHub Secrets 中的 CLOUDFLARE_API_TOKEN

获取 Cloudflare 账户 ID

  1. 账户 ID 可以在 Cloudflare 仪表盘的账户设置中找到。
  2. 复制到 GitHub Secrets 中的 CLOUDFLARE_ACCOUNT_ID

运行工作流

  1. 然后在Action页面手动运行工作流,后续同步上游后会自动部署到 Cloudflare Workers。如未配置 INIT_URL,则需要手动访问 https://你的项目域名/api/init/你的jwt_secret 进行数据库初始化。
  2. 自动同步上游可使用bot或者手动点击Sync Upstream按钮。

File: mail-vue/public/tinymce/langs/README.md

This is where language files should be placed.

Please DO NOT translate these directly, use this service instead: https://crowdin.com/project/tinymce


File: README-en.md

Description

With only one domain, you can create multiple different email addresses, similar to major email platforms. This project can be deployed on Cloudflare Workers to reduce server costs and build your own email service.

Project Showcase

Features

  • 💰 Low-Cost Usage: No server required — deploy to Cloudflare Workers to reduce costs.

  • 💻 Responsive Design: Automatically adapts to both desktop and most mobile browsers.

  • 📧 Email Sending: Integrated with Resend, supporting bulk email sending and attachments.

  • 🛡️ Admin Features: Admin controls for user and email management with RBAC-based access control.

  • 📦 Attachment Support: Send and receive attachments, stored and downloaded via R2 object storage.

  • 🔔 Email Push: Forward received emails to Telegram bots or other email providers.

  • 📡 Open API: Supports batch user creation via API and multi-condition email queries

  • 🔢 Verification Code Recognition: Auto-detect codes via Workers AI

  • 📈 Data Visualization: Use ECharts to visualize system data, including user email growth.

  • 🎨 Personalization: Customize website title, login background, and transparency.

  • 🤖 CAPTCHA: Integrated with Turnstile CAPTCHA to prevent automated registration.

  • 📜 More Features: Under development...

Tech Stack

Project Structure

text
cloud-mail
├── mail-worker				    # Backend worker project
│   ├── src                  
│   │   ├── api	 			    # API layer
│   │   ├── const  			    # Project constants
│   │   ├── dao                 # Data access layer
│   │   ├── email			    # Email processing and handling
│   │   ├── entity			    # Database entities
│   │   ├── error			    # Custom exceptions
│   │   ├── hono			    # Web framework, middleware, error handling
│   │   ├── i18n			    # Internationalization
│   │   ├── init			    # Database and cache initialization
│   │   ├── model			    # Response data models
│   │   ├── security			# Authentication and authorization
│   │   ├── service			    # Business logic layer
│   │   ├── template			# Message templates
│   │   ├── utils			    # Utility functions
│   │   └── index.js			# Entry point
│   ├── package.json			# Project dependencies
│   └── wrangler.toml			# Project configuration
│
├─ mail-vue				        # Frontend Vue project
│   ├── src
│   │   ├── axios 			    # Axios configuration
│   │   ├── components			# Custom components
│   │   ├── echarts			    # ECharts integration
│   │   ├── i18n			    # Internationalization
│   │   ├── init			    # Startup initialization
│   │   ├── layout			    # Main layout components
│   │   ├── perm			    # Permissions and access control
│   │   ├── request			    # API request layer
│   │   ├── router			    # Router configuration
│   │   ├── store			    # Global state management
│   │   ├── utils			    # Utility functions
│   │   ├── views			    # Page components
│   │   ├── app.vue			    # Root component
│   │   ├── main.js			    # Entry JS file
│   │   └── style.css			# Global styles
│   ├── package.json			# Project dependencies
└── └── env.release				# Environment configuration

License

This project is licensed under the MIT license.

Communication

Telegram