0

In Postfix we can apply some basic header, body, client checks using regex. I wanted to use flags.

I added the following to the header_checks file:

/some(\s|_|-)words(\s|_|-)here/gmi REJECT

and tested it by sending myself and email with those words in the title, but I get the error in my maillog stating unknown regexp option "g": skipping this rule

Is there a proper way to apply flags or does postfix regex simply not use or acknowlege certain flags?

Altimus Prime
  • 364
  • 2
  • 7
  • 22
  • 1
    If you meant to `REPLACE` instead of `REJECT`, it is still not possible, because header_checks stops searching after the first match is found. – anx Jun 18 '21 at 15:58

1 Answers1

2

There is no supported flag g, neither in POSIX regexp tables or PCRE tables. Therefore it's impossible to understand what you intended. Is that a typo? Just remove it.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • Thank you. I had copied it from another case I had done in a script. The only flag I really wanted was `i` but after reading the link you just shared, I learned that these in postfix the regex is case insensitive by default. – Altimus Prime Jun 19 '21 at 02:54