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

java.lang.Object
  extended by org.apache.james.protocols.smtp.core.fastfail.DNSRBLHandler
All Implemented Interfaces:
ConnectHandler<SMTPSession>, RcptHook

public class DNSRBLHandler
extends java.lang.Object
implements ConnectHandler<SMTPSession>, RcptHook

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
 void checkDNSRBL(SMTPSession session, java.lang.String ipAddress)
          This checks DNSRBL whitelists and blacklists.
 HookResult doRcpt(SMTPSession session, org.apache.mailet.MailAddress sender, org.apache.mailet.MailAddress rcpt)
          Return the HookResult after run the hook
 void onConnect(SMTPSession session)
          check if the remote Ip address is block listed
 void setBlacklist(java.lang.String[] blacklist)
          Set the blacklist array
 void setDNSService(DNSService dnsService)
          Sets the DNS service.
 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 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

setDNSService

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

Parameters:
dnsService - the dnsService to set

onConnect

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

Specified by:
onConnect in interface ConnectHandler<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

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.


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)


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