| .github/workflows | ||
| docs | ||
| frontend | ||
| worker | ||
| .dockerignore | ||
| .gitignore | ||
| .npmrc | ||
| .prettierignore | ||
| Dockerfile | ||
| LICENSE | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| prettierrc.json | ||
| README_en.md | ||
| README.md | ||
| wrangler.toml | ||
Features
- 🎯 Privacy-friendly, no registration required, out-of-the-box
- ✈️ Support email sending and receiving
- ✨ Support saving passwords and retrieving email addresses
- 😄 Support multiple domain name suffixes
- 🚀 100% open source, quick deployment, pure Cloudflare solution, no server required
Principles:
- Receiving emails (Cloudflare Email Worker)
- Display email (Vite + React on Cloudflare Pages)
- Mail Storage (Cloudflare D1)
- Node.js >= 18
Worker receives email -> saves to D1 database -> client queries email
Self-hosted Tutorial
This project is now fully based on Cloudflare Pages and Cloudflare D1, which greatly simplifies the deployment process. All you need is a domain name hosted on Cloudflare.
Requirements
- Cloudflare account and a domain name hosted on Cloudflare
- Local installation of Node.js (version >= 18.x) and pnpm
Automatic Deployment (Recommended)
This project includes a pre-configured GitHub Action workflow to help you automatically deploy the vMail application to Cloudflare.
For detailed steps, please refer to the GitHub Action Auto-Deployment Tutorial.
Manual Deployment Steps
-
Clone the project locally
git clone https://github.com/oiov/vmail cd vmail pnpm install -
Create a Cloudflare D1 Database Create a D1 database in the Cloudflare dashboard or using the Wrangler CLI.
-
Configure
wrangler.tomlReplace the${...}placeholders in thewrangler.tomlfile in the root directory with your Cloudflare and D1 configuration information. You can also set these values through environment variables in Cloudflare Pages. -
Build and Deploy
# Build the frontend application pnpm run build # Deploy to Cloudflare pnpm run deployWrangler will automatically handle the deployment of frontend static assets and the Worker, and apply database migrations according to the configuration.
-
Configure Email Routing Rules In your Cloudflare domain management interface, go to
Email->Email Routing->Routes, set up aCatch-allrule, and set the action toSend to a Worker, selecting the Worker you just deployed.
Local development
-
Copy the environment variable file
# This command creates a local environment variable file that wrangler dev will load automatically cp .env.example .env -
Fill in local environment variables Fill in the necessary environment variables in the
.envfile, especiallyD1_DATABASE_ID, etc. You need to create a D1 database in Cloudflare for local development first. -
Start the development server
pnpm run devThis command starts both the frontend Vite development server and the local Wrangler Worker environment at the same time.
Community Group
- Discord: https://discord.gg/d68kWCBDEs
License
GNU General Public License v3.0