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
相关产品推荐
相关产品推荐

