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

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.james.smtpserver.core.filter.fastfail.JunkScoreHandler
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, ConnectHandler, MessageHandler

public class JunkScoreHandler
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements ConnectHandler, MessageHandler, org.apache.avalon.framework.configuration.Configurable

Check if a configured JunkScore is reached and perform an action. Valid actions are: reject, compose, header. -Reject action reject the mail if the limit is reached. -Compose action stores the junkScore values in the mail attributes -Header action create headers which holds the junkScore for each check


Constructor Summary
JunkScoreHandler()
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration arg0)
           
 void onConnect(SMTPSession session)
           
 void onMessage(SMTPSession session)
           
 void setAction(java.lang.String action)
          Set the action to perform if the JunkScore limit is reached
 void setMaxScore(double maxScore)
          Set the max JunkScore
 
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

JunkScoreHandler

public JunkScoreHandler()
Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration arg0)
               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(org.apache.avalon.framework.configuration.Configuration)

setMaxScore

public void setMaxScore(double maxScore)
Set the max JunkScore

Parameters:
maxScore - the score

setAction

public void setAction(java.lang.String action)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Set the action to perform if the JunkScore limit is reached

Parameters:
action - the action
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - if invalid action is used

onMessage

public void onMessage(SMTPSession session)
Specified by:
onMessage in interface MessageHandler
See Also:
MessageHandler.onMessage(org.apache.james.smtpserver.SMTPSession)

onConnect

public void onConnect(SMTPSession session)
Specified by:
onConnect in interface ConnectHandler
See Also:
ConnectHandler.onConnect(org.apache.james.smtpserver.SMTPSession)


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