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

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.ResolvableEhloHeloHandler
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, CommandHandler
Direct Known Subclasses:
ReverseEqualsEhloHeloHandler

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

This CommandHandler can be used to reject not resolvable EHLO/HELO


Field Summary
static java.lang.String BAD_EHLO_HELO
           
protected  boolean checkAuthNetworks
           
protected  DNSService dnsServer
           
 
Constructor Summary
ResolvableEhloHeloHandler()
           
 
Method Summary
protected  boolean check(SMTPSession session)
          All checks must be done in this method
protected  void checkEhloHelo(SMTPSession session, java.lang.String argument)
          Check if EHLO/HELO is resolvable
 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 service(org.apache.avalon.framework.service.ServiceManager serviceMan)
           
 void setCheckAuthNetworks(boolean checkAuthNetworks)
          Set to true if AuthNetworks should be included in the EHLO/HELO check
 void setCheckAuthUsers(boolean checkAuthUsers)
          Set to true if Auth users should be included in the EHLO/HELO check
 void setDnsServer(DNSService dnsServer)
          Set the DNSService
 
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

BAD_EHLO_HELO

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

checkAuthNetworks

protected boolean checkAuthNetworks

dnsServer

protected DNSService dnsServer
Constructor Detail

ResolvableEhloHeloHandler

public ResolvableEhloHeloHandler()
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)

setCheckAuthNetworks

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

Parameters:
checkAuthNetworks - Set to true to enable

setCheckAuthUsers

public void setCheckAuthUsers(boolean checkAuthUsers)
Set to true if Auth users should be included in the EHLO/HELO check

Parameters:
checkAuthUsers - Set to true to enable

setDnsServer

public void setDnsServer(DNSService dnsServer)
Set the DNSService

Parameters:
dnsServer - The DNSService

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)

checkEhloHelo

protected void checkEhloHelo(SMTPSession session,
                             java.lang.String argument)
Check if EHLO/HELO is resolvable

Parameters:
session - The SMTPSession
argument - The argument

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()

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.