org.jasen.plugins
Class HeuristicScanner

java.lang.Object
  extended byorg.jasen.plugins.HeuristicScanner
All Implemented Interfaces:
JasenPlugin

public class HeuristicScanner
extends Object
implements JasenPlugin

Performs a heuristic scan of an email.

The scan is done across the entire message text (and html) and looks for known spam identifiers

The term "heuristic" in this context is defined as: "A method based on empirical information that has no explicit rationalization"
This essentially correlates to a "hard-coded" search for specific string patterns

The scanner makes use of a HeuristicAnalyzer to perform the analysis. The default analyzer for jASEN uses regular expressions to interrogate the email content.

Implementation Note: When adding heuristic definitions one should be very careful to ensure the definition is precise. An imprecise heuristic definition (regular expression) may lead to false identification of spam

Author:
Jason Polites

Constructor Summary
HeuristicScanner()
           
 
Method Summary
 void destroy()
          Destroys the plugin.
 void init(Properties properties)
          Initialises the plugin with the given properties
 JasenTestResult test(Jasen engine, javax.mail.internet.MimeMessage rawMessage, JasenMessage parsedMessage, ParserData data, ReceivedHeaderParser parser)
          Computess the "spamminess" of a message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeuristicScanner

public HeuristicScanner()
Method Detail

init

public void init(Properties properties)
          throws JasenException
Description copied from interface: JasenPlugin
Initialises the plugin with the given properties

Specified by:
init in interface JasenPlugin
Parameters:
properties -
Throws:
JasenException

destroy

public void destroy()
             throws JasenException
Description copied from interface: JasenPlugin
Destroys the plugin. This is called when the core jASEN engine is destroyed

Specified by:
destroy in interface JasenPlugin
Throws:
JasenException

test

public JasenTestResult test(Jasen engine,
                            javax.mail.internet.MimeMessage rawMessage,
                            JasenMessage parsedMessage,
                            ParserData data,
                            ReceivedHeaderParser parser)
                     throws JasenException
Description copied from interface: JasenPlugin
Computess the "spamminess" of a message.

Specified by:
test in interface JasenPlugin
Parameters:
engine - A reference to the current engine instance.
rawMessage - The original MimeMessage passed to the engine.
parsedMessage - The parsed JasenMessage returned from the MimeParser.
data - The data returned from the HTML Parser / Tokenizer combination.
parser - The parser used to parse mail headers
Returns:
A JasenTestResult
Throws:
JasenException - If an error occurs while performing the test