Loading... **说明:** `Forsaken Mail`是一个临时邮箱系统,可以供任何人接受邮件,即收即毁,支持自定义邮箱地址前缀,这里就说下 `Docker`和 `NPM`两种安装教程,任选一种即可,有兴趣或者有需求的可以玩玩。 提示:如果你不想自己搭建,只是想使用自己域名,可以直接使用本站服务,只需使将自己的域名创建域名cname记录到 [**mail.0du.win**](http://mail.0du.win/)等待生效即可. ## 需求[#](https://www.cnblogs.com/uztop/p/14972234.html#%E9%9C%80%E6%B1%82) 1、`VPS`需要开启 `25`端口,这个直接发工单要主机商开启。 2、域名解析,如果你想邮件地址格式都为 `*@xx.com`的形式,则为 `xx.com`设置 `MX`记录,需要添加以下 `2`条解析记录。 ```php #MX记录 xx.com MX 10 mx.xx.com #A记录 mx.xx.com A 服务器IP #PS:简化操作可以直接xx.com A 服务器IP ``` ## NPM安装[#](https://www.cnblogs.com/uztop/p/14972234.html#npm%E5%AE%89%E8%A3%85) Github地址:[https://github.com/denghongcai/forsaken-mail](https://github.com/denghongcai/forsaken-mail) ### 1、安装NPM ```php #Debian/Ubuntu系统 curl -sL https://deb.nodesource.com/setup_10.x | bash - apt-get install -y nodejs git screen #Centos系统 curl -sL https://rpm.nodesource.com/setup_10.x | bash - yum install nodejs git screen -y ``` ### 2、安装Forsaken Mail ```php #下载项目源码 git clone https://github.com/malaohu/forsaken-mail.git cd forsaken-mail #安装项目需要的库 npm install #安装pm2工具 npm install -g pm2 #禁用postfix和sendmail killall sendmail /etc/init.d/postfix stop chkconfig --level 2345 postfix off chkconfig --level 2345 sendmail off #启动项目 pm2 start bin/www #设置开机启动 pm2 startup pm2 save ``` 打开 `http//mx.xx.com:3000`就可以查看 `Forsaken Mail`邮箱界面了,如果你打不开界面,可能还需要开启防火墙端口,一般该情况在 `CentOS`系统上出现最多,这里就说下 `CentOS`开启操作。 ```php #Centos 6系统 iptables -I INPUT -p tcp --dport 3000 -j ACCEPT service iptables save service iptables restart #CentOS 7系统 firewall-cmd --zone=public --add-port=3000/tcp --permanent firewall-cmd --reload ``` ## Docker安装(推荐使用)[#](https://www.cnblogs.com/uztop/p/14972234.html#docker%E5%AE%89%E8%A3%85%E6%8E%A8%E8%8D%90%E4%BD%BF%E7%94%A8) ### 1、安装Docker ```php #CentOS 6 rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum update -y yum -y install docker-io service docker start chkconfig docker on #CentOS 7、Debian、Ubuntu curl -sSL https://get.docker.com/ | sh systemctl start docker systemctl enable docker ``` ### 2、安装Forsaken Mail ```php docker run --name forsaken-mail -d -p 25:25 -p 3000:3000 denghongcai/forsaken-mail ``` 安装成功后打开 `http//mx.xx.com:3000`就可以了  <hr class="content-copyright" style="margin-top:50px" /><blockquote class="content-copyright" style="font-style:normal"><p class="content-copyright">版权属于:大漠孤狼</p><p class="content-copyright">本文链接:<a class="content-copyright" href="https://www.dmgls.com/1323.html">https://www.dmgls.com/1323.html</a></p><p class="content-copyright">转载时须注明出处及本声明</p></blockquote> Last modification:March 14th, 2022 at 09:57 pm © 允许规范转载 Support 如果觉得我的文章对你有用,请随意赞赏 Appreciate the author