Connect. Communicate. Collaborate. Securely.

Home » Kerio User Forums » Kerio Connect » Can't get a wildcard filter to work
  •  
sedell

Messages: 1168
Karma: 1
Send a private message to this user
I can't for the life of me get this working. Our mail is filtered at the gateway. Spam mail has "[SPAM]" prepended to the subject. I'm trying to create a rule to filter this into the Junk E-mail folder, but only when the subject starts with [SPAM].

I created a rule matching "[SPAM]*", but it will not work. I know the wildcards are working because a rule matching "*[SPAM]*" catches it, but I'm back to the same point I was at using contains for the match type. I even tried "Subject*[SPAM]*" thinking that it possibly evaluates the entire line, but this didn't work either.

Is this a bug in the sieve implementation, or maybe a shortcoming of sieve? Is there something I'm missing?

Scott
  •  
winkelman

Messages: 2119
Karma: 3
Send a private message to this user
Sorry for the somewhat off-beat answer, but can't your gateway insert a header when it has determined a message to be spam? It's pretty common to apply the 'X-Spam-Flag: Yes' header for this. Then it becomes easy to filter based on this header...
  •  
sedell

Messages: 1168
Karma: 1
Send a private message to this user
It doesn't do X-Spam-Flag headers. It has a few other headers, which don't help since KOC doesn't let me do header filters, and/or it prepends a few different classifications to the subject line. I'm using the subject since I can't use the headers.

Now I'm having another issue. I left the rule in place "[SPAM]*" after unsuccessfully testing it, and now I'm finding other mail that does not contain "[SPAM]" redirected to my Junk Mail folder. Has anyone else run into issues with wildcards in message rules? The wildcard processing seems a bit bugged.

Scott
  •  
evsmetal

Messages: 42
Karma: 0
Send a private message to this user
Just wondering if the [ ] are throwing off the filter somehow.. If it's based on a regex I think [ ] are used as delimiters.

I know I had an issue trying to parse for ## in the mailbox rules. So it may be something along those lines.

Lastly, I wouldn't even use a wildcard.. Maybe just test for SPAM and be done with it..
  •  
sedell

Messages: 1168
Karma: 1
Send a private message to this user
I'm not sure about the [] brackets causing the problem. A filter for contains [SPAM], works fine. I've also since tried a matches filter for ?SPAM*, which didn't work either.

The reason I'm trying to make the change is all the lazy people out there. Their spam filter flags something [SPAM], then they don't bother to remove it from the subject when they reply or forward the message. We had a few at the top miss e-mail because of that, and well... no need to tell you what happens when the people at the top get pissed off.

I was able to get around the issue by manually editing the script to look for a combination of things - the header our gateway uses to mark spam, other keywords in the subject it uses when it can't quarantine messages, etc. I shouldn't have to do that though. Especially since the wildcards are listed in the rules interface, and savvy users might try to use them and have problems.

Scott
  •  
sedell

Messages: 1168
Karma: 1
Send a private message to this user
Actually, you seem to be right. I just checked the filters again to try a few more things, and it was "?SPAM]*" that wasn't working. "?SPAM*" seems to be. Frustrating since so much of the mail we get has [] brackets in the subject. Escaping them in the script doesn't help either. It only affects matches filters though. The other filter types seem to work with brackets.


Scott
  •  
winkelman

Messages: 2119
Karma: 3
Send a private message to this user
I assumed you did the filtering on the server, not client side (KOC).

I have an outside filter and I use the Spam setup to add x points when detecting a certain header (and this is completely configurable, so any type of header would do, as well as subject text etc.). And I simply configured that everything above x points is spam. So messages found to be spam by the outside filter are thus also spam within KMS and already placed in Junk Email on the server. No need for client filters.

Of course, all 'spam filter rating' (bayes, etc.) on KMS is disabled, cause the spam check has already happened outside.

What took me a while to find out was that while disabling 'spam filter rating' makes the whole settings page 'grayed out' (as if not at all applicable anymore), the now grayed out settings for tag score and block score are still applied.
Previous Topic: Thunderbird Address book problems
Next Topic: Mass auto reply message?
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: Fri Sep 22 04:46:10 CEST 2017

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