Connect. Communicate. Collaborate. Securely.

Home » Kerio User Forums » Kerio Connect » Spam regular expressions (Regular expressions in custom spam rules)
  •  
cslater@logicwave.co.uk

Messages: 3
Karma: -1
Send a private message to this user
We are receiving a lot of spam messages in which the subject contains one or more letters of the offensive word replaced by *. I read that regular expressions can only be used in email body rules, also that * in subject means one or more characters. It therefore seems impossible to frame a custom rule in the subject area to trap these, since there isn't any escape characters to make * mean that character only.

[Updated on: Sat, 30 July 2016 18:12]

  •  
j.a.duke

Messages: 335
Karma: 10
Send a private message to this user
cslater<_at_>logicwave.co.uk wrote on Sat, 30 July 2016 12:10
We are receiving a lot of spam messages in which the subject contains one or more letters of the offensive word replaced by *. I read that regular expressions can only be used in email body rules, also that * in subject means one or more characters. It therefore seems impossible to frame a custom rule in the subject area to trap these, since there isn't any escape characters to make * mean that character only.


Did you try escaping the "*" ("\*")?

According to most of the grep references I have, that is the proper syntax.

Cheers,
Jon
  •  
JJJCR

Messages: 110
Karma: -6
Send a private message to this user
agree with escaping the asterisk

like:

 [b]\f\*ck  matches f*ck[/b]
  •  
cslater@logicwave.co.uk

Messages: 3
Karma: -1
Send a private message to this user
Thanks for the replies, but the escape character doesn't work.

Perhaps someone from Kerio support would like to answer? As I said before the FAQ section says regular expressions are only supported in the email body section of custom rules.
  •  
MarkK

Messages: 454
Karma: 46
Send a private message to this user
You can do all of this using Spam Assassin and custom rules.

In the .\plugins\spamserver\spamassassin\rules\ folder, create a text file named something like "zMyRules.cf". The z in the file name will make sure this is the last rule file to be read in to memory, making it rules the last ones processed.

In the file put:

header lcl_SUBJECT_5 Subject =~ /(f\*ck)/i
score lcl_SUBJECT_5 5.0

This will add 5 points to the score for email that have f*ck in the subject.

Go to the Kerio Control Panel > Spam > Spam Assassin. Unselect the checkbox to use SA, Apply, Select the Use SA checkbox, Apply. This will get SA to re-read the rule files.
Previous Topic: Spam Filter - Custom Rules
Next Topic: Public Calendards in Webinterface and Android
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 Dec 05 09:28:56 CET 2016

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