Loading... 自己的域名邮箱想了很多次,也是一直使用别人家的域名邮箱,搭建自己的邮箱步骤还真是挺复杂的,根据网上大佬的教程,搭建了自己的邮箱。 Poste.io是一个开源的邮箱系统,本身利用Docker可以快速搭建,也方便后期修改和维护。 <!--more--> 本文更新于2020.5.12 > Poste.io是最近在国外非常火的轻量级邮件服务器。它具有非常高的稳定性,并提供非常出众的管理面板,能够轻易实现邮件收发、多域名控制、邮箱容量控制、邮件杀毒、邮件过滤以及Webmail等基础功能。同时,Poste还提供了投递统计分析、客户端自动适配、一键安装SSL证书、邮件转发、邮件别名、Catch-All等相当有用的功能。而且收发信可靠,非常适合个人、团体以及企业使用。另外,Poste邮件服务器基于Docker搭建,搭建过程十分简单。 ## 配置域名 购买一个com、net或者org,不推荐用icu等不受信任的域名后缀。 ````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````` qing.su A Any_IP mx.qing.su A 88.88.88.88 qing.su MX mx.qing.su. 10 mail.qing.su CNAME mx.qing.su. smtp.qing.su CNAME mx.qing.su. imap.qing.su CNAME mx.qing.su. qing.su TXT “v=spf1 mx ~all” _dmarc.qing.su TXT “v=DMARC1; p=none; rua=mailto:dmarc-reports@qing.su” 88.88.88.88 PTR mx.qing.su ````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````` ### 基础知识 - 设置rDNS,将1.1.1.2映射到mail1.wangchenyu.net.cn。DNS是域名->IP的解析。rDNS即IP->域名的解析。有了这个rDNS记录,收到邮件的服务器就能确认mail1.wangchenyu.net.cn可以被用在1.1.1.2这个IP上。一般在主机商后台可以添加rdns记录,找不到的话提交一个工单即可。 - 设置best.pm和best.nl的MX记录,记录名为@,值为mail1.wangchenyu.net.cn,优先级为10。MX记录用于别人向best.pm这个域发送邮件时查找收信服务器。不设置的话无法收到别人发的邮件,并且自己发出的邮件的“可信度”也会大大降低。优先级 - 设置DKIM签名。DKIM先由发件服务器生成,之后每封邮件都会带上这个签名。接着,还要在best.pm和best.nl上各添加一条TXT记录,记录名和值在发件服务器生成DKIM时都会提供。收到邮件后会对比邮件中的DKIM签名和DNS中的TXT记录是否一致。 - 设置SPF记录。这个记录规定了可以用这个域发邮件的主机。在best.pm和best.nl上各添加一条TXT记录,记录名为@,值为v=spf1 mx ~all即可允许所有IP使用此域。 - 设置DMARC记录。这个记录指出他们的地址被 SPF 和/或 DKIM/或别的方法保护。在best.pm和best.nl上各添加一条TXT记录,记录名为_dmarc,值为v=DMARC1; p=none ### 关于DKIM 需要根据自己的实际情况设置,在poste后台找到对应自己域名的内容: ![chrome_Qq3jJ55j8K.png](https://imgki.com/usr/uploads/2020/05/2453329054.png) ## Docker配置 ``````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````` #/srv/poste/data为Poste数据存放文件夹,如用户数据库、电子邮件、日志,方便备份。 docker run -d -p 25:25 -p 80:80 -p 110:110 -p 143:143 -p 443:443 -p 587:587 -p 993:993 -p 995:995 -v /etc/localtime:/etc/localtime:ro -v /srv/poste/data:/data --name "PosteServ" -h "mx.qing.su" -t analogic/poste.io ``````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````` 由于我和本机lnmp共存,所以不能使用80/443端口,用8081和7443代替。 ## Nginx反向代理 对于有强迫症的我,自然是看不上7443这样的端口,所以用Nginx反向代理mail域名 具体内容参见:[Nginx反向代理教程][2] --- 2019.3.20更新:宝塔反代真的好方便啊 最近把Poste搬迁到另外的一个主机上,新主机采用了宝塔,反代好方便,反代-SSL一气呵成。 ![chrome_k83nKIsKaC.png](https://imgki.com/usr/uploads/2019/03/1547751905.png)![chrome_hWul9wHxoK.png](https://imgki.com/usr/uploads/2019/03/4099657501.png) --- !>2019.6.28更新 提示listen tcp 0.0.0.0:587: bind: address already in use. 表明587端口被sendmail占用 通过netstat定位587端口被占用 `````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````` ubuntu@ip-172-26-26-9:~$ sudo netstat -pna | grep 587 tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN 1488/sendmail: MTA: `````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````` 彻底卸载 `````````````````````````````` sudo apt-get purge sendmail-* `````````````````````````````` 普通卸载 ``````````````````````````````` sudo apt-get remove sendmail-* ``````````````````````````````` --- **部分内容转自**:https://www.moerats.com/ [1]: https://imgki.com/usr/uploads/2020/05/2453329054.png [2]: https://imgki.com/archives/11.html [3]: https://imgki.com/usr/uploads/2019/03/1547751905.png [4]: https://imgki.com/usr/uploads/2019/03/4099657501.png Last modification:July 9, 2023 © Allow specification reprint Like 如果觉得我的文章对你有用,请随意赞赏
One comment
你好, 请问设置反向代理后,管理页面,还可以实时显示日志吗?我的设置后不能显示了。