org.apache.james.protocols.smtp.core.fastfail
Class ResolvableEhloHeloHandler

java.lang.Object
  extended by org.apache.james.protocols.smtp.core.fastfail.ResolvableEhloHeloHandler
All Implemented Interfaces:
HeloHook, RcptHook
Direct Known Subclasses:
ReverseEqualsEhloHeloHandler

public class ResolvableEhloHeloHandler
extends java.lang.Object
implements RcptHook, HeloHook

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


Field Summary
static java.lang.String BAD_EHLO_HELO
           
protected  DNSService dnsService
           
 
Constructor Summary
ResolvableEhloHeloHandler()
           
 
Method Summary
protected  boolean check(SMTPSession session, org.apache.mailet.MailAddress rcpt)
           
protected  void checkEhloHelo(SMTPSession session, java.lang.String argument)
          Check if EHLO/HELO is resolvable
 HookResult doHelo(SMTPSession session, java.lang.String helo)
          Return the HookResult after run the hook
 HookResult doRcpt(SMTPSession session, org.apache.mailet.MailAddress sender, org.apache.mailet.MailAddress rcpt)
          Return the HookResult after run the hook
 DNSService getDNSService()
          Gets the DNS service.
protected  boolean isBadHelo(SMTPSession session, java.lang.String argument)
           
 void setDNSService(DNSService dnsService)
          Sets the DNS service.
 
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

dnsService

protected DNSService dnsService
Constructor Detail

ResolvableEhloHeloHandler

public ResolvableEhloHeloHandler()
Method Detail

getDNSService

public final DNSService getDNSService()
Gets the DNS service.

Returns:
the dnsService

setDNSService

public final void setDNSService(DNSService dnsService)
Sets the DNS service.

Parameters:
dnsService - the dnsService to set

checkEhloHelo

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

Parameters:
session - The SMTPSession
argument - The argument

isBadHelo

protected boolean isBadHelo(SMTPSession session,
                            java.lang.String argument)
Parameters:
session - the SMTPSession
argument - the argument
Returns:
true if the helo is bad.

check

protected boolean check(SMTPSession session,
                        org.apache.mailet.MailAddress rcpt)
See Also:
org.apache.james.smtpserver.core.filter.fastfail.AbstractJunkHandler#check(org.apache.james.protocols.smtp.SMTPSession)

doRcpt

public HookResult doRcpt(SMTPSession session,
                         org.apache.mailet.MailAddress sender,
                         org.apache.mailet.MailAddress rcpt)
Description copied from interface: RcptHook
Return the HookResult after run the hook

Specified by:
doRcpt in interface RcptHook
Parameters:
session - the SMTPSession
sender - the sender MailAddress
rcpt - the recipient MailAddress
Returns:
HookResult
See Also:
RcptHook.doRcpt(org.apache.james.protocols.smtp.SMTPSession, org.apache.mailet.MailAddress, org.apache.mailet.MailAddress)

doHelo

public HookResult doHelo(SMTPSession session,
                         java.lang.String helo)
Description copied from interface: HeloHook
Return the HookResult after run the hook

Specified by:
doHelo in interface HeloHook
Parameters:
session - the SMTPSession
helo - the helo name
Returns:
HockResult
See Also:
HeloHook.doHelo(org.apache.james.protocols.smtp.SMTPSession, java.lang.String)


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.