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

Postfix中Received头部字符串替换配置后无法接收邮件问题求助

Postfix中Received头部字符串替换配置后无法接收邮件问题求助

我现在在用Postfix,想要把Received头部里的字符串14.03.0513.000替换成15.20.7091.31,比如下面这个头部:

Received: from srv1.somedomain.com ([11.12.13.14]) by srv2 ([12.13.14.15]) with mapi id 14.03.0513.000; Fri, 15 Dec 2023 14:28:13 -0500

但我一直没搞对语法,我在/etc/postfix/header_checks里写了这样的规则:

/^Received:(.*)14\.03\.0513\.000(.*)/ REPLACE Received:${1}15.20.7091.31${2}

结果一启用这个配置,Postfix就没法接收入站邮件了,会报错451 4.3.0 Error: queue file write error。

不过我用这个命令测试的时候是正常的:

postmap -q "Received: from srv1.somedomain.com ([11.12.13.14]) by srv2 ([12.13.14.15]) with mapi id 14.03.0513.000; Fri, 15 Dec 2023 14:28:13 -0500" regexp:/etc/postfix/header_checks

返回的结果是正确的替换后的头部:

REPLACE Received: from srv1.somedomain.com ([11.12.13.14]) by srv2 ([12.13.14.15]) with mapi id 15.20.7091.31; Fri, 15 Dec 2023 14:28:13 -0500

明明测试是对的,但Postfix还是拒绝邮件,有没有大佬知道我哪里漏了?

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.20 12:39:52