📫 An open source temporary email tool. 只需一个域名部署临时邮箱,支持多域名后缀,密码找回。
Go to file
2024-04-06 17:03:29 +08:00
apps add random separator 2024-04-06 17:03:29 +08:00
packages transfer repo 2024-04-04 12:20:51 +08:00
.dockerignore transfer repo 2024-04-04 12:20:51 +08:00
.gitignore transfer repo 2024-04-04 12:20:51 +08:00
.prettierignore transfer repo 2024-04-04 12:20:51 +08:00
Dockerfile transfer repo 2024-04-04 12:20:51 +08:00
LICENSE transfer repo 2024-04-04 12:20:51 +08:00
package.json transfer repo 2024-04-04 12:20:51 +08:00
pnpm-lock.yaml feat: send email 2024-04-05 15:06:39 +08:00
pnpm-workspace.yaml transfer repo 2024-04-04 12:20:51 +08:00
prettierrc.json transfer repo 2024-04-04 12:20:51 +08:00
README_en.md upd docs 2024-04-06 10:48:54 +08:00
README.md upd docs 2024-04-06 10:48:54 +08:00

𝐕𝐌𝐀𝐈𝐋.𝐃𝐄𝐕

English | 简体中文

Temporary email service build with email worker.

Features

  • 🎯 Privacy-friendly, no registration required, out-of-the-box
  • ✈️ Support email sending and receiving
  • Better UI design, more concise
  • 🚀 100% open source, quick deployment, no server required

Principles

  • Receiving emails (email worker)
  • Display email (remix)
  • Mail Storage (sqlite)

Worker receives email -> saves to database -> client queries email

Self-hosted Tutorial

Requirements

  • Cloudflare account and a domain name hosted on Cloudflare
  • turso sqlite (a free plan available for personal use)
  • Vercel or fly.io to deploy Remix app

Steps

1.Register a turso account, create a database, and create an emails table

After registration, you will be prompted to create a database. I named it vmail here,

Then, Create a table named emails. Select your database, you will see the "Edit Tables" button, click and enter.

⚠️ Note: There is a plus button in the upper left corner, and I tried to click it without any prompts or effects, so I used the cli provided by turso to initialize the table.

Cli documents: https://docs.turso.tech/cli/introduction

For Linux (or mac/windows):

# Install (Remember to restart the terminal after installation)
curl -sSfL https://get.tur.so/install.sh | bash

# Authenticate
turso auth login

# Connect to your Turso database
turso db shell <database-name>

# Copy sql script to run on the terminal (packages/database/drizzle/0000_sturdy_arclight.sql)
CREATE TABLE `emails` (
 `id` text PRIMARY KEY NOT NULL,
 `message_from` text NOT NULL,
 `message_to` text NOT NULL,
 `headers` text NOT NULL,
 `from` text NOT NULL,
 `sender` text,
 `reply_to` text,
 `delivered_to` text,
 `return_path` text,
 `to` text,
 `cc` text,
 `bcc` text,
 `subject` text,
 `message_id` text NOT NULL,
 `in_reply_to` text,
 `references` text,
 `date` text,
 `html` text,
 `text` text,
 `created_at` integer NOT NULL,
 `updated_at` integer NOT NULL
);

2.Deploy email workers

git clone https://github.com/yesmore/vmail

cd vmail

# Install dependencies
pnpm install

Fill in the necessary environment variables in vmail/apps/email-worker/wrangler.toml file.

  • TURSO_DB_AUTH_TOKEN (turso table info from step 1click Generate Token)
  • TURSO_DB_URL (e.g. libsql://db-name.turso.io)
  • EMAIL_DOMAIN (e.g. vmail.dev)

If you don't do this step, you can add environment variables in the worker settings of Cloudflare

Then run cmds:

cd apps/email-worker

# Node environment required, and your need to install wrangler cli and login first, see https://developers.cloudflare.com/workers/wrangler/install-and-update
pnpm run deploy

3.Configure email routing rules

Set Catch-all action to Send to Worker

4.Deploy Remix app on Vercel or fly.io

Ensure that the following environment variables (.env.example) are prepared and filled in during deployment:

Variable Description example
COOKIES_SECRET The encryption secret of the cookie, a random string is sufficient s3cr3t
TURNSTILE_KEY Obtained from Cloudflare for website verification 1234567890
TURNSTILE_SECRET Obtained from Cloudflare for website verification s3cr3t
TURSO_DB_RO_AUTH_TOKEN Obtain database credentials from turso eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
TURSO_DB_URL Obtain database credentials from turso libsql://db-name.turso.io
EMAIL_DOMAIN email domain vmail.dev
EXPIRY_TIME optional, default 86400 86400

For Vercel:

Deploy your own version of email to Vercel with one click:

Deploy with Vercel

Or push the code to your Github repository and create a new project in Vercel. Choose New project, then import the corresponding Github repository, fill in the environment variables, select the Remix framework, and click Deploy. Wait for the deployment to complete.

Click Couninue to Dashboard -> Settings -> General:

For fly.io:

cd vmail/apps/remix 
fly launch

5.Add DNS records (A record) to the corresponding platform in Cloudflare

e.g. vercel

Done!

Local development

copy apps/remix/.env.example to apps/remix/.env and fill in the necessary environment variables.

cd path-to/vmail/ # root directory
pnpm install

# run on localhost:3000
pnpm run remix:dev

Community Group

License

GNU General Public License v3.0

Star History

Star History Chart

Inspired by smail.pw & email.ml