On 3 Feb 2021, at 4:49, Linkcheck wrote:

I'm normally careful about this matter but it has happened twice in a couple of months now due, I admit, to my own carelessness but dumping a lot of mail before the error was noticed.

The specific problem is with extra or multiple OR bars in pcre checks. For example:

/trap this|/
/|trap this/
/trap||this/

Is there a Lint tool that can check for this or be adapted easily? Or perhaps a different method?

None of those would necessarily be caught by a generalized 'lint' tool for the unfortunate reason that people intentionally do a lot of objectively bonkers things with regular expressions. Those are all technically valid, albeit entirely irrational, regular expressions.

To specifically test for matching the null string in a pcre table, you can use this:

postmap -q '' pcre:/etc/postfix/my_suspect_table

That should always return no output with a result code of 1. If your 'make' skills are good (or even just barely useful) it should be easy to make that part of a target that tests a table before copying it into place.



--
Bill Cole
b...@scconsult.com or billc...@apache.org
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Not Currently Available For Hire

Reply via email to