You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何让Postfix通过LMTP更好地向Dovecot交付邮件?虚拟域与中继配置方式对比

如何让Postfix通过LMTP更好地向Dovecot交付邮件?虚拟域与中继配置方式对比

嘿,如果你正在折腾Postfix通过LMTP给Dovecot递邮件,这里有两种经过行业大佬验证的靠谱配置思路,咱们来唠唠细节:

1. 虚拟域配置方案(Kyle Dent推荐)

这个方案是Postfix领域专家Kyle Dent在他的著作里主推的,特别适合你想用Postfix不原生支持的私有邮件存储(比如mdbox)的场景。

首先在Postfix主配置文件中添加以下配置项:

virtual_mailbox_domains = hash:/etc/postfix/virtual_domains
virtual_mailbox_maps = hash:/etc/postfix/virtual_recipients
virtual_transport = lmtp:unix:/var/imap/socket/lmtp

对应的配套配置文件内容如下:

  • /etc/postfix/virtual_domains(用来定义虚拟域):
a.com -
b.com -
  • /etc/postfix/virtual_recipients(用来定义合法的虚拟收件人):
z@a.com -
z@b.com -

2. 中继配置方案(Peer Heinlein推荐)

另一位大佬——Dovecot权威著作作者Peer Heinlein更推荐这种把Postfix当作中继的配置方式,他认为这种模式逻辑更清晰合理。

需要在Postfix主配置文件中添加这些配置项:

relay_domains = hash:/etc/postfix/transport
relay_recipient_maps = hash:/etc/postfix/relay_recipients
transport_maps = hash:/etc/postfix/transport

对应的配套配置文件内容:

  • /etc/postfix/transport(用来指定域对应的LMTP传输方式):
a.com lmtp:unix:/var/imap/socket/lmtp
b.com lmtp:unix:/var/imap/socket/lmtp

(注:原文中relay_recipie...应为relay_recipients配置文件,内容格式与虚拟收件人类似,需列出所有合法的中继收件人,例如z@a.com -)

备注:内容来源于stack exchange,提问作者Ilya Ordin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.17 11:33:13