临时邮箱又称为一次性邮箱,可以用于各类不常用网站注册帐号等使用,避免邮件地址泄露造成被骚扰。
Forsaken mail
Forsaken mail是一款即收即毁的临时邮箱系统。
原作者开源地址:https://github.com/denghongcai/forsaken-mail
安装步骤
安装环境
yum install git nodejs npm -y
如果你的服务器是国内服务器的话需要设置下npm的国内镜像源,不然等会安装库时会很慢,国外服务器忽视下面步骤
npm config set registry https://mirrors.huaweicloud.com/repository/npm/
npm cache clean -f
下载项目
git clone https://github.com/malaohu/forsaken-mail.git
cd forsaken-mail
安装项目需要的库
npm install
安装pm2工具
npm install -g pm2
禁用postfix和sendmail
很多人因为没有禁用postfix和sendmail导致25端口被占用无法启动
killall sendmail
chkconfig --level 2345 postfix off
chkconfig --level 2345 sendmail off
systemctl stop postfix
systemctl disable postfix.service
启动临时邮箱并设置开机启动
pm2 start bin/www
pm2 startup
pm2 save
设置Nginx反代
location /
{
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
add_header X-Cache $upstream_cache_status;
add_header Cache-Control no-cache;
expires 12h;
}
很多人会出现Socket连接失败,主要是反代设置缺少以下代码
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";