一份针对2026年的自建邮件服务器指南详细阐述了个人用户在家自建邮件服务的可行性与实现路径[1]。
硬件与网络基础
自建邮件服务器需要满足几项关键网络条件[1]:静态IPv4地址、非CGNAT网络环境、可修改PTR记录权限,以及邮件服务器所需端口(25、143、465、587、993)的开放权限。即使互联网中断少于40%的时间,邮件投递仍能正常进行,因为发送方会自动重试[1]。
软件与配置方案
指南推荐采用docker-mailserver作为完整的邮件服务器解决方案[1]。DNS配置方面需要设置SPF、DKIM、DMARC、MX和PTR记录[1]。在邮件客户端选择上,建议使用Thunderbird[1]。
反垃圾邮件方案
为了实现与Gmail相当的反垃圾邮件效果,指南提出利用本地LLM(Gemma 4 12B QAT)通过rspamd的GPT插件进行邮件分类[1]。这款LLM可在GPU上运行,也可仅使用7GB RAM/VRAM的CPU环境运行[1]。
运维保障
指南强调必须制定备份计划并至少进行一次恢复测试[1]。
A comprehensive guide for hosting your own mail server at home has been shared, outlining both the technical prerequisites and practical solutions for achieving reliable email delivery comparable to commercial providers. [1]
Prerequisites and Infrastructure
To run a mail server from a residential connection, several network requirements must be met: a static IPv4 address, connectivity that is not behind Carrier-Grade NAT (CGNAT), the ability to modify PTR records, and access to open mail server ports including 25, 143, 465, 587, and 993. [1]
The guide notes that service interruptions of less than 40 percent are tolerable, as sending mail servers will automatically retry delivery during downtime. [1]
Software and Configuration
Docker-mailserver is recommended as a complete, integrated mail server solution. [1] The implementation requires configuring multiple DNS records: SPF, DKIM, DMARC, MX, and PTR records. [1]
For the mail client, Thunderbird is suggested as the preferred choice. [1]
Spam Filtering with Local AI
A distinctive approach to spam prevention involves deploying a local large language model—specifically Gemma 4 12B in quantized format—integrated through rspamd's GPT plugin for email classification. [1] This configuration can run on modest hardware: either a GPU or a CPU-only setup with as little as 7 GB of RAM or VRAM. [1] The local LLM approach reportedly achieves spam filtering performance equivalent to Gmail's systems. [1]
Operational Considerations
The guide emphasizes that establishing and testing a backup recovery plan is mandatory before deployment. [1]