Score:0

How do you use regex flags in postfix?

ca flag

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?

anx avatar
fr flag
anx
If you meant to `REPLACE` instead of `REJECT`, it is still not possible, because header_checks stops searching after the first match is found.
Score:2
cz flag

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.

ca flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.