https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8283

            Bug ID: 8283
           Summary: Negating matches in URIDetail
           Product: Spamassassin
           Version: SVN Trunk (Latest Devel Version)
          Hardware: PC
                OS: Windows 10
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Plugins
          Assignee: dev@spamassassin.apache.org
          Reporter: k...@mxguardian.net
  Target Milestone: Undefined

Negative matching in uri_detail rules is tricky because keys can contain
multiple values. For example, consider the following data structure:

  {
    host => {
      'id.me' => 1,
      'example.com' => 1,
    },
    text => [
      'Login to ID.me'
    ]
  }

The rule 'host !~ /^id\.me$/' would be true, because 'example.com' does not
match the regex. Currently, there is no way to check if ALL hosts do not match.
I am proposing a patch that introduces an alternative syntax:

   '!host =~ /^id\.me$/' 

which is the logical negation of 'host =~ /^id\.me$/'. This rule would only be
true if all hosts do not match the regex. 

The new syntax is IN ADDITION TO the existing syntax so it's not a breaking
change. 

I've been using this in production for awhile. If there are no comments after a
few days I will go ahead and commit.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to