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

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

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

This MessageHandler could be used to check message against spamd before accept the email. So its possible to reject a message on smtplevel if a configured hits amount is reached. The handler add the follow attributes to the mail object:
org.apache.james.spamassassin.status - Holds the status org.apache.james.spamassassin.flag - Holds the flag
Sample Configuration:

<handler class="org.apache.james.smtpserver.SpamAssassinHandler"> <spamdHost>localhost</spamdHost> <spamdPort>783</spamdPort>
<spamdRejectionHits>15.0</spamdRejectionHits> <checkAuthNetworks>false</checkAuthNetworks> </handler>


Constructor Summary
SpamAssassinHandler()
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration arg0)
           
 void onMessage(SMTPSession session)
           
 void setCheckAuthNetworks(boolean checkAuthNetworks)
          Set to true if AuthNetworks should be included in the EHLO check
 void setSpamdHost(java.lang.String spamdHost)
          Set the host the spamd daemon is running at
 void setSpamdPort(int spamdPort)
          Set the port the spamd damon is listen on
 void setSpamdRejectionHits(double spamdRejectionHits)
          Set the hits on which the message will be rejected.
 
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

SpamAssassinHandler

public SpamAssassinHandler()
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(Configuration)

setCheckAuthNetworks

public void setCheckAuthNetworks(boolean checkAuthNetworks)
Set to true if AuthNetworks should be included in the EHLO check

Parameters:
checkAuthNetworks - Set to true to enable

setSpamdHost

public void setSpamdHost(java.lang.String spamdHost)
Set the host the spamd daemon is running at

Parameters:
spamdHost - The spamdHost

setSpamdPort

public void setSpamdPort(int spamdPort)
Set the port the spamd damon is listen on

Parameters:
spamdPort - the spamdPort

setSpamdRejectionHits

public void setSpamdRejectionHits(double spamdRejectionHits)
Set the hits on which the message will be rejected.

Parameters:
spamdRejectionHits - The hits

onMessage

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


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