creating rules

Matt Kettler mkettler at EVI-INC.COM
Thu Sep 29 00:13:40 IST 2005


    [ The following text is in the "ISO-8859-1" character set. ]
    [ Your display is set for the "US-ASCII" character set.  ]
    [ Some characters may be displayed incorrectly. ]

Jon Miller wrote:
> I need to create a rule where if the subject has Re[1]: or any number between the [] that it is picked up as spam.  How do I create the header so that it's a single entry yet works for any number from a blank [] to any character? 
> Does the * works and means anything?
> 
> ex:
> # 15 Subject: Re[1]:
> header PROLO_GSPAM15 Subject =~ /Re[*]:/i
> score PROLO_GSPAM15 8
> describe PROLO_GSPAM15 Spam - custom rule set

1) * isn't a character wildcard in regex, it's a repeat-count wildcard. ie: d*
will match any number of d's in a row (including 0).

2) anytime you want to use a bracket, you must escape it with a backslash,
otherwise you're declaring a character range. i.e.: [a-z] will match any single
lower-case letter.

3) \d is a good way to match a "numeric digit" and is equivalent to [0-9]


in light of 1-3 I'd rewrite that as:

header PROLO_GSPAM15 Subject =~ /Re\[\d\]:/i

That said, I'd be very wary of assigning an 8-point score to such a rule.

You WILL get false positives, because there ARE real mail clients that do that
to messages, for example Microsoft outlook with the auto-bcc plugin.

------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the Wiki (http://wiki.mailscanner.info/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!



More information about the MailScanner mailing list