Hi Robert,

I am not a regex wiz either but I will give you a working example I hope
will help.

> -----Original Message-----
> From: Robert Mikelsons

> Hello,
> I'm SpamAssasin user for some time.
> I still recieve a spam which gets fairly low score (2.5), due 
> it is looking like kinda ordinary mail. I'm not good at 
> regexps (seeing the syntax alone makes me nuts) so i couldn't 
> add the rule i wanted. The rule of my idea is to add a 
> subject and/or body check for the username in the e-mail 
> address. My address, [EMAIL PROTECTED] has some numbers 
> at the end of it. Often i recieve spam which takes username, 
> as it would be my name, example: "Hello Roberts83", or 
> "Roberts83, Get this product!" or similar.
> 
> Ordinary people who would write a mail to address, let's say 
> [EMAIL PROTECTED] most likely would make subject "Hello 
> Jeff" and not "Jeff2002". So i can assume that if there is 
> such signature in the mail, then a score about 1.0 or 1.5 
> should be given.
> 
> Could anyone who is good in regexps show me couple of lines 
> required to add the new rule. Rule shouldt take recipient's 
> e-mail address and check the subject and body for username of e-mail.
> 
> With hopes,
> Robert (and not Roberts83 :)

Here is an example alias in the subject:

# Alias (i.e. Roberts83) in the subject
header   MY_Alias_Subj  Subject =~ /\bRoberts83\b/i
describe MY_Alias_Subj  Alias in the subject
score    MY_Alias_Subj  1.5

# I have not tested this one but it should work
# Alias (i.e. Roberts83) in the body
body     MY_Alias_Body  /\bRoberts83\b/i
describe MY_Alias_Body  Alias in the subject
score    MY_Alias_Body  1.5

The \b is a word boundary.  If Roberts83 is surrounded by text then you
might just want to drop it as Roberts83 is unique and should not produce
false positives.  You will need to experiment.  So far the \b works for me.
The i at the end of the regex means case insensitive so it would also catch
RObertS83.  You may want to watch out for a 0 (zero) variant in which you
would check for o or 0.  Example:

header   MY_Alias_Subj  Subject =~ /\bR[o0]berts83\b/i
body     MY_Alias_Body  /\bR[o0]berts83\b/I

This would catch roberts83 or r0berts83.

Check out the rules emporium at:
http://www.merchantsoverseas.com/wwwroot/gorilla/sa_rules.htm

--Larry



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to