Postfix 个人传输异常

Postfix 个人传输异常

(我可以不先打招呼吗?)

我正在运行 Postfix 服务器,它具有以下内容transport_map

charlie.localdomain smtp:[sierra.localdomain]:10025

现在我想发送邮件特定收件人通过另一个具有特殊过滤器的监听器进行路由,因此我将收件人添加到传输图中:

[email protected]    smtp:[127.0.0.1]:1025

...并将:1025监听器添加到 ,如下charlie所示master.cf(为简单起见,暂时省略 milter):

1025      inet  n       -       n       -       -       smtpd
    -o syslog_name=postfix/spamsocket
    -o alias_maps=
    -o virtual_alias_maps=
    -o canonical_maps=
    -o sender_canonical_maps=
    -o transport_maps=
    -o default_transport=smtp:[sierra.localdomain]:10025

现在我给 发了一封邮件specialguy。收到的反馈还不错:

Apr 13 16:49:17 charlie postfix/smtpd[25477]: Anonymous TLS connection established from tango.localdomain...
Apr 13 16:49:18 charlie postfix/smtpd[25477]: 09B26200F887: client=tango.localdomain
Apr 13 16:49:18 charlie postfix/cleanup[25481]: 09B26200F887: message-id=...
Apr 13 16:49:19 charlie postfix/qmgr[21852]: 09B26200F887: from=<sender>, size=2056, nrcpt=1 (queue active)
Apr 13 16:49:19 charlie postfix/smtpd[25477]: disconnect from tango.localdomain

...并正确转发给1025听众,但立即开始循环:

Apr 13 16:49:19 charlie postfix/spamsocket/smtpd[25484]: connect from localhost[127.0.0.1]
Apr 13 16:49:19 charlie postfix/spamsocket/smtpd[25484]: B051120AD3E2: client=localhost[127.0.0.1]
Apr 13 16:49:19 charlie postfix/cleanup[25481]: B051120AD3E2: message-id=...
Apr 13 16:49:19 charlie postfix/qmgr[21852]: B051120AD3E2: from=<sender>, size=3798, nrcpt=1 (queue active)
Apr 13 16:49:19 charlie postfix/spamsocket/smtpd[25484]: disconnect from localhost[127.0.0.1]
Apr 13 16:49:19 charlie postfix/smtp[25483]: 09B26200F887: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:1025, delay=1.7, delays=1.7/0.01/0.02/0.02, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as B051120AD3E2)
Apr 13 16:49:19 charlie postfix/qmgr[21852]: 09B26200F887: removed
Apr 13 16:49:19 charlie postfix/spamsocket/smtpd[25484]: connect from localhost[127.0.0.1]
Apr 13 16:49:19 charlie postfix/spamsocket/smtpd[25484]: B9A4B20AD3E9: client=localhost[127.0.0.1]
Apr 13 16:49:19 charlie postfix/cleanup[25481]: B9A4B20AD3E9: message-id=...
Apr 13 16:49:19 charlie postfix/qmgr[21852]: B9A4B20AD3E9: from=<sender>, size=3982, nrcpt=1 (queue active)
Apr 13 16:49:19 charlie postfix/smtp[25483]: B051120AD3E2: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:1025, delay=0.05, delays=0.01/0/0.02/0.01, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as B9A4B20AD3E9)
[ ... 40 repeats ... ]

在我看来,1025:侦听器决定查看一下transport_map(即使它被明确告知不要这样做),并将邮件循环回自身。有什么想法可以让它不这样做吗?

PS:整个事情的根本原因是,“主”:25侦听器配置了 spamassassin 邮件过滤器,但如果收到多收件人邮件,则不会查询各个贝叶斯数据库,这可能是由于邮件过滤器协议的限制。我想要的是,:25接收方将所有邮件重新发送给自己:1025 逐一(我猜是使用某种\*_destination_recipient_limit参数),并在新侦听器上设置 spamass-milter。我试图尽可能透明地进行此实验,只影响specialguy@服务器的正常运行。

答案1

发生循环是因为两个smtpd实例共享同一个队列。

https://upload.wikimedia.org/wikipedia/commons/e/ed/Postfix_architecture.svg

即邮件通过 进入:25,放入active队列,然后根据参数qmgr决定转发给。localhost:1025transport_maps

现在,邮件将进入同一个邮件服务器:1025被放入同一个队列20 goto 10

一个解决方案是给予第二个smtpd监听器一个单独的queue_service_nameand/or cleanup_service_name,但这需要对 CentOS 的 SELinux 设置进行大量手动修改。

postmulti解决方案:通过(运行多个实例http://www.postfix.org/MULTI_INSTANCE_README.html

相关内容