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

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.james.smtpserver.core.filter.fastfail.AbstractJunkHandler
          extended by org.apache.james.smtpserver.core.filter.fastfail.DNSRBLHandler
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, CommandHandler, ConnectHandler

public class DNSRBLHandler
extends AbstractJunkHandler
implements ConnectHandler, CommandHandler, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.service.Serviceable

Connect handler for DNSRBL processing


Field Summary
static java.lang.String RBL_BLOCKLISTED_MAIL_ATTRIBUTE_NAME
           
static java.lang.String RBL_DETAIL_MAIL_ATTRIBUTE_NAME
           
 
Constructor Summary
DNSRBLHandler()
           
 
Method Summary
protected  boolean check(SMTPSession session)
          All checks must be done in this method
 void checkDNSRBL(SMTPSession session, java.lang.String ipAddress)
          This checks DNSRBL whitelists and blacklists.
 void configure(org.apache.avalon.framework.configuration.Configuration handlerConfiguration)
           
 java.util.Collection getImplCommands()
          Return a Collection of implemented commands
 JunkHandlerData getJunkHandlerData(SMTPSession session)
          Get the JunkHandlerData to work with
protected  JunkScore getJunkScore(SMTPSession session)
          Return the JunkScore object.
 void onCommand(SMTPSession session)
          Handle the command
 void onConnect(SMTPSession session)
          check if the remote Ip address is block listed
 void service(org.apache.avalon.framework.service.ServiceManager serviceMan)
           
 void setBlacklist(java.lang.String[] blacklist)
          Set the blacklist array
 void setDNSServer(DNSService dnsServer)
          Set the DNSService
 void setGetDetail(boolean getDetail)
          Set for try to get a TXT record for the blocked record.
 void setWhitelist(java.lang.String[] whitelist)
          Set the whitelist array
 
Methods inherited from class org.apache.james.smtpserver.core.filter.fastfail.AbstractJunkHandler
doProcessing, getAction, getScore, setAction, setScore
 
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
 

Field Detail

RBL_BLOCKLISTED_MAIL_ATTRIBUTE_NAME

public static final java.lang.String RBL_BLOCKLISTED_MAIL_ATTRIBUTE_NAME
See Also:
Constant Field Values

RBL_DETAIL_MAIL_ATTRIBUTE_NAME

public static final java.lang.String RBL_DETAIL_MAIL_ATTRIBUTE_NAME
See Also:
Constant Field Values
Constructor Detail

DNSRBLHandler

public DNSRBLHandler()
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
Overrides:
configure in class AbstractJunkHandler
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
Configurable.configure(Configuration)

service

public void service(org.apache.avalon.framework.service.ServiceManager serviceMan)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException
See Also:
Serviceable.service(ServiceManager)

onConnect

public void onConnect(SMTPSession session)
check if the remote Ip address is block listed

Specified by:
onConnect in interface ConnectHandler
See Also:
ConnectHandler.onConnect(SMTPSession)

setWhitelist

public void setWhitelist(java.lang.String[] whitelist)
Set the whitelist array

Parameters:
whitelist - The array which contains the whitelist

setBlacklist

public void setBlacklist(java.lang.String[] blacklist)
Set the blacklist array

Parameters:
blacklist - The array which contains the blacklist

setDNSServer

public void setDNSServer(DNSService dnsServer)
Set the DNSService

Parameters:
dnsServer - The DNSService

setGetDetail

public void setGetDetail(boolean getDetail)
Set for try to get a TXT record for the blocked record.

Parameters:
getDetail - Set to ture for enable

checkDNSRBL

public void checkDNSRBL(SMTPSession session,
                        java.lang.String ipAddress)
This checks DNSRBL whitelists and blacklists. If the remote IP is whitelisted it will be permitted to send e-mail, otherwise if the remote IP is blacklisted, the sender will only be permitted to send e-mail to postmaster (RFC 2821) or abuse (RFC 2142), unless authenticated.


getImplCommands

public java.util.Collection getImplCommands()
Description copied from interface: CommandHandler
Return a Collection of implemented commands

Specified by:
getImplCommands in interface CommandHandler
Returns:
Collection which contains implemented commands
See Also:
CommandHandler.getImplCommands()

onCommand

public void onCommand(SMTPSession session)
Description copied from interface: CommandHandler
Handle the command

Specified by:
onCommand in interface CommandHandler
See Also:
CommandHandler.onCommand(SMTPSession)

check

protected boolean check(SMTPSession session)
Description copied from class: AbstractJunkHandler
All checks must be done in this method

Specified by:
check in class AbstractJunkHandler
Parameters:
session - the SMTPSession
Returns:
true if the check match
See Also:
AbstractJunkHandler.check(org.apache.james.smtpserver.SMTPSession)

getJunkScore

protected JunkScore getJunkScore(SMTPSession session)
Description copied from class: AbstractJunkHandler
Return the JunkScore object.

Overrides:
getJunkScore in class AbstractJunkHandler
Returns:
junkScore
See Also:
AbstractJunkHandler.getJunkScore(org.apache.james.smtpserver.SMTPSession)

getJunkHandlerData

public JunkHandlerData getJunkHandlerData(SMTPSession session)
Description copied from class: AbstractJunkHandler
Get the JunkHandlerData to work with

Specified by:
getJunkHandlerData in class AbstractJunkHandler
Parameters:
session - the SMTPSession
Returns:
junkHandlerData
See Also:
AbstractJunkHandler.getJunkHandlerData(org.apache.james.smtpserver.SMTPSession)


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