后缀pcre条件REPLACE

只有当“Message-Id:”以定义的string开始时,我才需要修改传入电子邮件中的“From:”标题行。 所以在main.cf我把:

header_checks = pcre:/etc/postfix/header_checks 

和header_checks文件包含:

 if /^Message-Id: <footext.+/ /^From: (.*)@johndoe.com/ REPLACE From: ${1}@ext.johndoe.com endif 

它不起作用,条件不需要。 我错过了什么?

http://www.postfix.org/header_checks.5.html

如果/模式/标志

  endif Match the input string against the patterns between if and endif, if and only if ----> the same <----- input string also matches /pattern/. 

您不能使用if / endif块来匹配不同的标题。