Skip to content

hellochaoslabs/cloud-mail

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloud Mail Logo

Cloud Mail

A lightweight, responsive email service built with Vue 3. Supports attachments, email routing, and can be deployed to Cloudflare for free! 🎉


Overview

Cloud Mail is a simple, self-hosted email service that allows you to create multiple email addresses with just a single domain—similar to Gmail or QQ Mail. Built to run entirely on Cloudflare Workers, Cloud Mail requires no server costs and uses Resend for reliable email delivery.


Live Demo & Docs


Features

  • 💰 Completely Free: No server needed. Deploy directly to Cloudflare Workers.
  • 💻 Responsive UI: Fully responsive for both desktop and mobile.
  • 📧 Advanced Email Sending: Send emails with embedded images, attachments, bulk support, and delivery status via Resend.
  • 🛡️ Admin Panel: Manage users and emails with RBAC permission control.
  • 🔀 Multi-Account Mode: Users can manage multiple email addresses under one account.
  • 📦 Attachment Support: Receive and store attachments via Cloudflare R2.
  • 🔔 Email Push: Forward incoming mail to Telegram bots or external email services.
  • 📈 Data Visualization: Track usage and statistics using ECharts.
  • Starred Emails: Mark important emails for quick access.
  • 🎨 Customizable: Configure site title, login background, and theme opacity.
  • ⚙️ Feature Toggles: Enable/disable features like registration and mail sending.
  • 🤖 Bot Protection: Integrated Turnstile CAPTCHA for human verification.
  • 📜 More Features Coming Soon...

Tech Stack


Getting Started

Prerequisites

  • Node.js v18.20 or higher
  • A Cloudflare account with a connected domain

Clone the Repository

git clone https://github.com/LaziestRen/cloud-mail
cd cloud-mail/mail-worker

Install Dependencies

npm install

Configure Environment

Edit mail-worker/wrangler.toml:

[[d1_databases]]
binding = "db"
database_name = ""
database_id = ""

[[kv_namespaces]]
binding = "kv"
id = ""

[[r2_buckets]]
binding = "r2"
bucket_name = ""

[assets]
binding = "assets"
directory = "./dist"

[vars]
orm_log = false
domain = ["example.com"]
admin = "admin@example.com"
jwt_secret = "your_jwt_secret"

Deploy to Cloudflare

  1. Create KV, D1, and R2 resources in the Cloudflare dashboard.
  2. Update wrangler.toml with the correct IDs and names.
  3. Deploy the project:
npm run deploy
  1. Configure email routing:
    • Cloudflare > Email > Routing > Catch-all → route to the Worker.
  2. Initialize the database:
    • Visit: https://yourdomain.com/api/init/your_jwt_secret
  3. Log in as admin and configure R2, Turnstile keys, etc.

➡️ Deploy via GitHub Action


Local Development

npm run dev
  • Local D1 and R2 will auto-generate under .wrangler/.
  • Initialize local DB via:
    http://127.0.0.1:8787/api/init/your_jwt_secret
  • Set R2 domain to:
    http://127.0.0.1:8787/api/file

Email Sending Configuration

  1. Sign up at resend.com
  2. Under Domains, add and verify your domain.
  3. Under API Keys, generate a token and paste it into the Cloud Mail settings.
  4. Under Webhooks, add:
https://yourdomain.com/api/webhooks

And enable these events:

  • email.bounced
  • email.complained
  • email.delivered
  • email.delivery_delayed

Project Structure

cloud-mail
├── mail-worker
│   ├── src
│   │   ├── api
│   │   ├── const
│   │   ├── email
│   │   ├── entity
│   │   ├── error
│   │   ├── hono
│   │   ├── init
│   │   ├── model
│   │   ├── security
│   │   ├── service
│   │   ├── utils
│   │   └── index.js
│   ├── package.json
│   └── wrangler.toml
└── mail-vue
    ├── src
    │   ├── assets
    │   ├── axios
    │   ├── components
    │   ├── layout
    │   ├── request
    │   ├── router
    │   ├── store
    │   ├── utils
    │   ├── views
    │   ├── app.vue
    │   ├── main.js
    │   └── style.css
    ├── package.json
    └── env.dev

License

This project is licensed under the MIT License.


Community

📢 Join our Telegram group: https://t.me/cloud_mail_tg

About

cloudflare email 邮箱 临时邮箱 邮件发送 mail

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 61.0%
  • Vue 38.2%
  • Other 0.8%