原创文章,转载请注明出处
https://qiedd.com/

0. 简介

Forsaken mail 是一个临时邮箱系统,可以创建临时邮箱来收取一些验证码。

1. 域名解析

这里使用 Cloudflare 解析

添加一条 A 记录,比如 email -> 1.1.1.1


随后添加一条 MX 记录 email -> email.example.com

2. 安装

安装 Docker

https://docs.docker.com/engine/install/debian/

# Debian/Ubuntu
curl -fsSL https://get.docker.com -o get-docker.sh

# Arch
pacman -S docker
安装 Caddy

https://caddyserver.com/docs/install

# Debian/Ubuntu
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo tee /etc/apt/trusted.gpg.d/caddy-stable.asc
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

# Arch
pacman -S caddy
# 启动 Docker 服务
systemctl start docker
systemctl enable docker

# 下载源码
git clone https://github.com/denghongcai/forsaken-mail

# 进入目录
cd forsaken-mail

# 构建镜像
docker build -t forsaken-mail .

# 运行镜像
docker run -d --name forsaken-mail --restart=always -p 25:25 forsaken-mail

# 查看容器ip
docker inspect forsaken-mail

## 找到这里
## "IPAddress": "172.17.0.3",

# 修改Caddyfile
vim /etc/caddy/Caddyfile

{
        servers :443 {
                protocol {
                        allow_h2c
                        experimental_http3
                }
        }
        servers :80 {
                protocol {
                        allow_h2c
                        experimental_http3
                }
        }
}
import /etc/caddy/conf.d/*

# 创建文件
vim /etc/caddy/conf.d/forsaken-mail

email.example.com {
        reverse_proxy 172.17.0.3:3000
        file_server
}

# 启动Caddy
systemctl start caddy
systemctl enable caddy
分类: DockerLinux

0 条评论

发表回复

Avatar placeholder

您的电子邮箱地址不会被公开。

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据