Page Index Toggle Pages: 1
Topic Tools
Normal Topic Anti-Spam / Spam Rule Definitions (Read 6,893 times)
OH Eng
Past Team Members
Documentation Team
Offline



Posts: 4,026
Location: Pensacola, Florida USA
Anti-Spam / Spam Rule Definitions
Nov 9th, 2007 at 9:43pm
Post Tools
Hey, good job all you YaBB 2.2 developers!!!

When you get some time after enjoying your well deserved champagne Smiley, could one of you PERLspeakers post a reference or an explanation of what these Spam Rule Definitions are in the Admin Center/Security Center/Anti-Spam section, and how to use them? 

Something like:

command, what it does, syntax for using it, etc.

Thanks!
  

 
Back to top
 
IP Logged
 
Matt Siegman
YaBB Legends (Inactive)
*
Offline



Posts: 3,380
Location: Wichita, KS
Re: Anti-Spam / Spam Rule Definitions
Reply #1 - Nov 10th, 2007 at 9:00pm
Post Tools
Overview of =; and ~;
Using ~; instead of =; will allow the spam engine to match a substring, for example, with a ~; "hi" will math "hi", "high", "higher". Using an equals =; "hi" will match "hi" only. (Technically it'll match on a word boundary, but you don't need to worry about that.)

Example:
Code
Select All
1=;hi
42~;hi 


These commands set a different threshold for spam than the default (1). So using the first rule, one instance of "hi" will mark the message as spam. Using the second, the string "hi",  "higher", etc would have to match 42 times before tripping the spam limit.

Also note, that unless this limit is specified, any matches will trip the spam detection.

Allowed Syntax

It looks like you can pretty much use any regex syntax you want in your spam filter, so it's quite powerful. The string that you use will be split on =; or ~; if that is in there, so i'd recommend not using that in your regexes Wink. The string that you specify will then be interpolated into a regex, and processed.

The code that eventually processes the spam regexes is:
Code
Select All
		if ($spamtype eq "S" ) { #~;
			@spamcount = $testcontent =~ /$spamword/gsi;
		} elsif ($spamtype eq "E" ) { #=;
			@spamcount = $testcontent =~ /\b$spamword\b/gsi;
		} 



So, you need to follow whatever rules perl has on regexes. Luckily, these are easily found in the following ways:
Visit the following URL:
http://perldoc.perl.org/perlre.html

If you have shell access, you can type:
Code
Select All
perldoc perlre 


perldoc is a documentation tool available with all standard perl installs. If you can run YaBB, you most likely have it.

Explaining the default rules
The default rule file follows:
Code
Select All
agap(.?)rnis
10~;p(.?)rn
3=;sell 



The first line will match "agap" and "rnis" with one or zero characters between, and declare spam on the first finding. EG: "agap rnis", "agap a rnis", "agap d rnis"  (note I added the spaces so this message won't be called spam Wink)

The second line will match "p" and "rn" with one or zero characters between the two, and declares the message spam after 10 instances. EG: "prn", "pern", "pdrn"

The third line will match the word "sell" whenever it stands by itself. (It matched the word in this line because " counts as a word boundary.) It will declare the message spam after three instances.
  

-- Matt Siegman 8) Wish List
Back to top
 
IP Logged
 
OH Eng
Past Team Members
Documentation Team
Offline



Posts: 4,026
Location: Pensacola, Florida USA
Re: Anti-Spam / Spam Rule Definitions
Reply #2 - Nov 11th, 2007 at 9:24am
Post Tools
Many thanks, Matt!  That's exactly what I needed to know.  Smiley
  

 
Back to top
 
IP Logged
 
Tea-Master
YaBB Legends (Active)
*
Offline



Posts: 3,628
Location: Germany
Re: Anti-Spam / Spam Rule Definitions
Reply #3 - Jan 13th, 2008 at 10:51am
Post Tools
i would suggest adding this to the yabb codex. anybody?
  

--> also known as Agent Zed Wink
Back to top
 
IP Logged
 
Monsen
YaBB Legends (Active)
*
Offline



Posts: 10,103
Location: Bergen, Norway

YaBB 2.3
Re: Anti-Spam / Spam Rule Definitions
Reply #4 - Jan 13th, 2008 at 1:45pm
Post Tools
Tea-Master wrote on Jan 13th, 2008 at 10:51am:
i would suggest adding this to the yabb codex. anybody?

Posted to the 'Understaning the Admin Center' category on the codex.

Thanks Matt.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools