SOLVED Account level filter "or" failing

bear

Well-Known Member
Sep 24, 2002
129
4
168
cPanel Access Level
Root Administrator
Creating a filter for a single email account based on "from" and "does not contain" domain.tld to fail with error message works perfectly. Add an "or" and a second identical line (with a different domain), and it fails totally, rejecting all email, even from the valid domains in the filter. Checking the logs, it's just saying it was failed because of the filter.

I'd swear this has worked in the past, but I can't get it to allow more than one such line. I've tried all sorts of different criteria in this, and they all fall over. Have I missed something, or possibly misconfigured something on the server(s)? More than one server does this.
 

rpvw

Well-Known Member
Jul 18, 2013
1,088
446
113
Spain
cPanel Access Level
Root Administrator
Create multiple rules rather than a complex and/or rule.
Important:

We strongly recommend that you use multiple, simple filters instead of a single large filter. Exim, the server's mail transfer agent, handles many small rules more efficiently than it handles one large rule.
If you want your 2 line rule to work to discard messages that do not have a from <contains> example.com or from <contains> example.net ..... somewhat unintuitively, use the AND operator.
See the following screenshot filter.jpeg

Also, remember that complex and/or rules are processed as follows:
Important

When you create a filter that uses several operators, the system processes the and operator before the or operator. For example:

  • The system processes A or B and C as A or (B and C).
  • The system processes A and B or C as (A and B) or C.
 
Last edited:

bear

Well-Known Member
Sep 24, 2002
129
4
168
cPanel Access Level
Root Administrator
Counter intuitive indeed, but that works. :P
Using AND instead of OR allows the filter to process only the wanted domains, and reject all others.
Thanks!
 

rpvw

Well-Known Member
Jul 18, 2013
1,088
446
113
Spain
cPanel Access Level
Root Administrator
I think you will find the confusion stems from the comparator used:

Does NOT contain .... something
AND
Does NOT contain .... something else
AND
Does NOT contain .... something else
Then do this action

or

Contains ... something
OR
Contains ... something else
OR
Contains ... something else
Then do this action