Connect. Communicate. Collaborate. Securely.

Home » Kerio User Forums » Kerio Connect » Filter rules, change "or" to "and"
  •  
shtaffa

Messages: 41
Karma: 0
Send a private message to this user
I'm looking for a way to change the "or" to an "and" in a mail filter. I would imagine that I could do it with sieve, but all my attempts have created errors.

I'm looking to create a rule that will move a message and mark it read if it is from a particular sender and if it contains both of two key words in the subject. When I go through the GUI (either web or in Outlook) to create this rule, it automatically inserts an "or" between the two words that I'm wanting to match in the subject.

I don't see any way within the interface that I can change the "or" to an "and". The sieve code that is generated for the rule I'm creating is as follows:

if allof (address :all :contains "From" "reports<_at_>test.com" , header :contains "Subject" ["word1", "word2"] ) 
{
  fileinto "Deleted Items";
  setreadflag;
}


I've tried adding ":all" to the header portion of the code and I get an error stating it's an invalid tag.

How would I modify the rule to make it do what I'm looking for?

Thank you.
  •  
clan

Messages: 236
Karma: 22
Send a private message to this user
You already have allof for the and-condition, all you need to do is make a rule per keyword:

if allof (address :all :contains "From" "reports<_at_>test.com" , header :contains "Subject" "word1", header :contains "Subject" "word2" ) 
{
  fileinto "Deleted Items";
  setreadflag;
}


This is generated by Kerio if you add the keywords separately

[Updated on: Fri, 25 August 2017 14:48]

  •  
shtaffa

Messages: 41
Karma: 0
Send a private message to this user
That works. Thanks!

What do you mean by "add the keywords separately"? Any way that I've found to add the keywords for the subject it always ends up putting an "or" between them. For example the exact rule, as stated in the Kerio Filter Rule interface states:

Apply this rule when the message arrives.
Where the From line 'reports<_at_>test.com'
and Where the Subject line contains 'word1' or 'word2'
Move it to Deleted Items
and Mark as read


I'd love to find some way to do it through the GUI so I could show my users.
  •  
freakinvibe

Messages: 1552
Karma: 62
Send a private message to this user
This can be done via the GUI:

Choose "All" on top

Then add the From rule

Then add the subject rule with only one word

Then add another subject rule with the second word

That's it. Don't stuff both words in one rule.

Dexion AG - The Blackberry Specialists in Switzerland
https://dexionag.ch
  •  
shtaffa

Messages: 41
Karma: 0
Send a private message to this user
I'm sorry, I'm really not following that. Possibly you're referencing the interface in a different version of Connect? We're still on 8.5.2.

I don't see a place to select "All". I can only add one subject rule per filter. Once the box is checked it's checked and there's nothing I can do other than add more words to that instance of the subject rule.
  •  
freakinvibe

Messages: 1552
Karma: 62
Send a private message to this user
I am on version 9, that might explain it.

Dexion AG - The Blackberry Specialists in Switzerland
https://dexionag.ch
  •  
shtaffa

Messages: 41
Karma: 0
Send a private message to this user
Looks like it's time for me to upgrade.

Thanks for all of the help, everyone.
  •  
shtaffa

Messages: 41
Karma: 0
Send a private message to this user
I upgraded my mail server to 9.2.3 last night. I avoided 9.2.4 due to the speed issues I've seen reported in these forums.

I still have exactly the same interface for adding filtering rules. The interface that I'm referring to is the one in Outlook. There is no way for it to match on one criteria "and" a second one for one test, without possibly manually manipulating the filter code. That's unfortunate. The functionality exists in webmail, but appears to be the only place it exists. The vast majority of my users use Outlook and I shouldn't have to ask them to log into webmail or learn sieve to setup a rule.
  •  
freakinvibe

Messages: 1552
Karma: 62
Send a private message to this user
That is possible. I don't use Outlook. I was always talking about the Web Interface. Sorry for the misunderstanding.

Dexion AG - The Blackberry Specialists in Switzerland
https://dexionag.ch
Previous Topic: error mail message
Next Topic: Kerio + outlook 2016 in Activesync
Goto Forum:
  


Disclaimer:
Kerio discussion forums are intended for open communication between forum members and may contain information and material posted by members which may be useful in learning about Kerio products. The discussion forums are not intended to provide technical support for any specific product. Any information implied or expressed in the discussion forums is that of the posting member. Kerio is in no way responsible for the information posted in the forums, or its accuracy. Kerio employees may participate in the discussions, but their postings do not represent an offical position of the company on any issues raised or discussed. Kerio reserves the right to monitor and maintain the forums to promote free and accurate exchange of information.

Current Time: Mon Nov 20 03:22:35 CET 2017

Total time taken to generate the page: 0.00468 seconds
.:: Contact :: Home ::.
Powered by: FUDforum 3.0.4.