GFI Software

Welcome to the GFI Software community forum! For support please open a ticket from https://support.gfi.com.

Home » GFI User Forums » Kerio Connect » Spam regular expressions (Regular expressions in custom spam rules)
Spam regular expressions [message #131115] Sat, 30 July 2016 18:10 Go to next message
cslater@logicwave.co.uk is currently offline  cslater@logicwave.co.uk
Messages: 3
Registered: February 2013
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]

Report message to a moderator

Re: Spam regular expressions [message #131140 is a reply to message #131115] Mon, 01 August 2016 20:57 Go to previous messageGo to next message
j.a.duke is currently offline  j.a.duke
Messages: 239
Registered: October 2006
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
Re: Spam regular expressions [message #131143 is a reply to message #131140] Tue, 02 August 2016 06:59 Go to previous messageGo to next message
JJJCR is currently offline  JJJCR
Messages: 85
Registered: April 2012
Location: phil
agree with escaping the asterisk

like:

 [b]\f\*ck  matches f*ck[/b]
Re: Spam regular expressions [message #131148 is a reply to message #131143] Tue, 02 August 2016 11:38 Go to previous messageGo to next message
cslater@logicwave.co.uk is currently offline  cslater@logicwave.co.uk
Messages: 3
Registered: February 2013
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.
Re: Spam regular expressions [message #131535 is a reply to message #131115] Thu, 25 August 2016 20:46 Go to previous message
MarkK is currently offline  MarkK
Messages: 342
Registered: April 2007
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:
  


Current Time: Sun Apr 02 10:48:48 CEST 2023

Total time taken to generate the page: 0.03414 seconds