chriscorcoran Posted July 5, 2023 Share Posted July 5, 2023 is it possible to have more than one Rule Expression, so I want to take inbound emails from a specific domain with a specific subject, ideally contains specific words in a subject would be better. so the Rule Expression would be something like fromAddress = 'ABC@domain.com' subjectContains ='orangesandlemons' does that work? Link to comment Share on other sites More sharing options...
Steve Giller Posted July 5, 2023 Share Posted July 5, 2023 The syntax is very similar to a SQL WHERE clause, so you'd need to use AND between them, but it looks about right. Link to comment Share on other sites More sharing options...
Gerry Posted July 5, 2023 Share Posted July 5, 2023 @chriscorcoran From what you have described, something along these lines... fromAddress LIKE '%@domain.com' AND subject LIKE '%orangesandlemons%' ought to do it. Basically, as @Steve Giller says, this expression syntax is SQL-like in its syntax. The above will match any from address where the domain is @domain.com and where the word 'orangesandlemons' is contained within the subject. The documentation you need is here: https://wiki.hornbill.com/index.php?title=Inbound_Routing_Rules Gerry Link to comment Share on other sites More sharing options...
HHH Posted July 6, 2023 Share Posted July 6, 2023 @chriscorcoran From experience I found that AND takes preference over OR so A OR B AND C would be interpreted as A OR (B AND C) so if you want (A OR B ) AND C you need to use parenthesis Link to comment Share on other sites More sharing options...
Gerry Posted July 6, 2023 Share Posted July 6, 2023 Relevant... SQL Operator Precedence refers to the order in which different operators are evaluated in an SQL statement. When an SQL query contains multiple operators, the operator precedence determines the sequence in which they are executed to evaluate the expression. Here is a typical operator precedence hierarchy in SQL, starting from the highest precedence to the lowest: Parentheses: Operators enclosed in parentheses are evaluated first. Parentheses can be used to explicitly control the order of evaluation. Unary Operators: Unary operators, such as the negation operator (-) or logical NOT operator (NOT), have higher precedence than binary operators. Multiplication, Division, and Modulo: Operators like multiplication (*), division (/), and modulo (%) have higher precedence than addition and subtraction. Addition and Subtraction: The addition (+) and subtraction (-) operators have the same precedence and are evaluated from left to right. Comparison Operators: Comparison operators, such as equality (=), inequality (<> or !=), greater than (>), less than (<), etc., are evaluated after arithmetic operators. They are used to compare values and return a Boolean result. Logical Operators: Logical operators, such as AND, OR, and NOT, are evaluated after comparison operators. They are used to combine multiple conditions and return a Boolean result. It's important to note that the actual operator precedence may vary slightly depending on the specific database management system (DBMS) being used. Therefore, it's always a good practice to use parentheses to explicitly group expressions and clarify the desired order of evaluation, especially when combining different operators in complex queries. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now