org.apache.james.smtpserver.core.filter.fastfail
Class AbstractJunkHandler

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.james.smtpserver.core.filter.fastfail.AbstractJunkHandler
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled
Direct Known Subclasses:
DNSRBLHandler, MaxRcptHandler, ResolvableEhloHeloHandler, SPFHandler, URIRBLHandler, ValidRcptMX, ValidSenderDomainHandler

public abstract class AbstractJunkHandler
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements org.apache.avalon.framework.configuration.Configurable


Constructor Summary
AbstractJunkHandler()
           
 
Method Summary
protected abstract  boolean check(SMTPSession session)
          All checks must be done in this method
 void configure(org.apache.avalon.framework.configuration.Configuration handlerConfiguration)
           
protected  void doProcessing(SMTPSession session)
          Process the checking
protected  java.lang.String getAction()
          Return the action
abstract  JunkHandlerData getJunkHandlerData(SMTPSession session)
          Get the JunkHandlerData to work with
protected  JunkScore getJunkScore(SMTPSession session)
          Return the JunkScore object.
protected  double getScore()
          Return the configured score
 void setAction(java.lang.String action)
          Set the Action which should be taken if the mail from has no valid domain.
 void setScore(double score)
          Set the score which will get added to the JunkScore object if the action is junkScore andt the sender has no valid domain
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJunkHandler

public AbstractJunkHandler()
Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration handlerConfiguration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
Configurable.configure(Configuration)

setAction

public void setAction(java.lang.String action)
Set the Action which should be taken if the mail from has no valid domain. Supported are: junkScore and reject

Parameters:
action - the action

setScore

public void setScore(double score)
Set the score which will get added to the JunkScore object if the action is junkScore andt the sender has no valid domain

Parameters:
score - the score

getScore

protected double getScore()
Return the configured score

Returns:
score

getAction

protected java.lang.String getAction()
Return the action

Returns:
action

doProcessing

protected void doProcessing(SMTPSession session)
Process the checking

Parameters:
session - the SMTPSession

check

protected abstract boolean check(SMTPSession session)
All checks must be done in this method

Parameters:
session - the SMTPSession
Returns:
true if the check match

getJunkHandlerData

public abstract JunkHandlerData getJunkHandlerData(SMTPSession session)
Get the JunkHandlerData to work with

Parameters:
session - the SMTPSession
Returns:
junkHandlerData

getJunkScore

protected JunkScore getJunkScore(SMTPSession session)
Return the JunkScore object.

Returns:
junkScore


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.