Hi Viktor,

> On Apr 7, 2018, at 1:26 AM, Viktor Dukhovni <postfix-us...@dukhovni.org> 
> wrote:
>> On Apr 7, 2018, at 1:23 AM, J Doe <gene...@nativemethods.com> wrote:
>> 
>> I did some Googling for doing PCRE to POSIX regular expressions and updated 
>> the string:
>> 
>>   
>> /^(Received:\sfrom)[^;]+(;\s[A-Z]{1}[a-z]{2,3},)\s+([[:digit:]]{1,2}[^\n]+)/ 
>> REPLACE $1 [127.0.0.1] (localhost [127.0.0.1]) by myserver.com$2 $3
>> 
>> … and it works!
> 
> It can't, the above is still PCRE, "\s" for whitespace is PCRE, not "regexp". 
>  Perhaps that's no the string you're using.
> 
> My advice is to ditch regexp and use PCRE.  Install the package that adds 
> PCRE support.

Hmmm.  I just sent a test message via submission to a Gmail account and checked 
the headers and the replacement works.

According to the site [1]   \s is shorthand for POSIX regular expressions.

Perhaps the POSIX regex library compiled with Postfix now supports this ?

Sources:

[1] https://www.regular-expressions.info/posixbrackets.html 

Reply via email to