群晖无公网自建邮件服务器

Security Classification: 【C-1】 | Publish Time:2024-06-23 | Category:Test Notes | Edit
Latest Version
Expiry Notice: The article was published three months ago. Please independently assess the validity of the technical methods and code mentioned within. :)

AI Summary: 本文讨论了自建邮件服务器的原因、基础设施、邮件发送原理、端口穿透及配置域名解析等步骤。自建的好处包括数据管控和避免第三方泄露,但也面临伪造邮件无法识别的问题。通过使用DKIM验证可以缓解此问题,同时提到发信打分的挑战,尤其是家庭宽带IP与邮件服务器的关联性。最后建议通过脚本自动修正SPF记录或使用其他SMTP服务器来优化发件效果。 --- (From Model:gpt-4o-mini-2024-07-18)

为什么自建?

1、数据不再托管,自己管控、审核内容。避免三方泄露数据与未授权查看数据。
2、挖群晖漏洞。

基础设施

1、未ban 25端口的服务器(推荐华为云香港,境外不ban)
2、群晖一台,可装mailplus。

理解邮件发送原理

略。

端口穿透

在套件中心安装完MailPlus后,我们需要把一些端口代理出去。群晖可以装npc,nps安装也非常快。

  1. 1 2024-06-23 19:37:34 root lsof -i :25 //华为云安装的centos7出厂自己会占用25端口,找到pid kill掉就行
  2. 2 2024-06-23 19:37:51 root curl cip.cc
  3. 3 2024-06-23 19:38:39 root wget https://github.com/ehang-io/nps/releases/download/v0.26.10/linux_amd64_server.tar.gz //nps版本自选
  4. 4 2024-06-23 19:38:52 root ls
  5. 5 2024-06-23 19:39:18 root tar -zxvf linux_amd64_server.tar.gz //解压
  6. 6 2024-06-23 19:39:22 root cd nps
  7. 7 2024-06-23 19:39:24 root ls
  8. 8 2024-06-23 19:39:30 root ls -al
  9. 9 2024-06-23 19:39:51 root sudo ./nps install //安装
  10. 10 2024-06-23 19:40:02 root vim /etc/nps/conf/nps.conf //编辑配置

这样nps就装好了,群晖装npc只需要套件中心安装即可。最后应该转发了这些端口:

配置域名解析


Comment List

© Copyright: This article is an original work and the copyright belongs to the  Depy's docs  unless marked as Reproduced

Please contact the blogger for authorization to reprint