public class DNSRBLHandler extends Object implements RcptHook
| Modifier and Type | Field and Description |
|---|---|
static String |
RBL_BLOCKLISTED_MAIL_ATTRIBUTE_NAME |
static String |
RBL_DETAIL_MAIL_ATTRIBUTE_NAME |
| Constructor and Description |
|---|
DNSRBLHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkDNSRBL(SMTPSession session,
String ipAddress)
This checks DNSRBL whitelists and blacklists.
|
HookResult |
doRcpt(SMTPSession session,
MailAddress sender,
MailAddress rcpt)
Return the HookResult after run the hook
|
protected boolean |
resolve(String ip)
Check if the given ipaddress is resolvable.
|
protected Collection<String> |
resolveTXTRecords(String ip)
Return a
Collection which holds all TXT records for the ip. |
void |
setBlacklist(String[] blacklist)
Set the blacklist array
|
void |
setGetDetail(boolean getDetail)
Set for try to get a TXT record for the blocked record.
|
void |
setWhitelist(String[] whitelist)
Set the whitelist array
|
public static final String RBL_BLOCKLISTED_MAIL_ATTRIBUTE_NAME
public static final String RBL_DETAIL_MAIL_ATTRIBUTE_NAME
public void setWhitelist(String[] whitelist)
whitelist - The array which contains the whitelistpublic void setBlacklist(String[] blacklist)
blacklist - The array which contains the blacklistpublic void setGetDetail(boolean getDetail)
getDetail - Set to ture for enablepublic void checkDNSRBL(SMTPSession session, String ipAddress)
protected boolean resolve(String ip)
InetAddress.getByName(String). Sub-classes may override this with a more performant solutionip - protected Collection<String> resolveTXTRecords(String ip)
Collection which holds all TXT records for the ip. This is most times used to add details for a RBL entry.
This implementation always returns an empty Collection. Sub-classes may override this.ip - public HookResult doRcpt(SMTPSession session, MailAddress sender, MailAddress rcpt)
RcptHookdoRcpt in interface RcptHooksession - the SMTPSessionsender - the sender MailAddressrcpt - the recipient MailAddressorg.apache.james.protocols.smtp.hook.RcptHook#doRcpt(org.apache.james.protocols.smtp.SMTPSession, org.apache.mailet.MailAddress, org.apache.mailet.MailAddress)Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.