public abstract class AbstractGreylistHandler extends Object implements RcptHook
| Constructor and Description |
|---|
AbstractGreylistHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
cleanupAutoWhiteListGreyList(long time)
Cleanup the autowhitelist
|
protected abstract void |
cleanupGreyList(long time)
Delete old entries from the Greylist datarecord
|
HookResult |
doRcpt(SMTPSession session,
MailAddress sender,
MailAddress rcpt)
Return the HookResult after run the hook
|
protected abstract Iterator<String> |
getGreyListData(String ipAddress,
String sender,
String recip)
Get all necessary data for greylisting based on provided triplet
|
protected abstract void |
insertTriplet(String ipAddress,
String sender,
String recip,
int count,
long createTime)
Insert new triplet in the store
|
void |
setAutoWhiteListLifeTime(long autoWhiteListLifeTime) |
void |
setTempBlockTime(long tempBlockTime) |
void |
setUnseenLifeTime(long unseenLifeTime) |
protected abstract void |
updateTriplet(String ipAddress,
String sender,
String recip,
int count,
long time)
Update the triplet
|
public void setUnseenLifeTime(long unseenLifeTime)
public void setAutoWhiteListLifeTime(long autoWhiteListLifeTime)
public void setTempBlockTime(long tempBlockTime)
protected abstract Iterator<String> getGreyListData(String ipAddress, String sender, String recip) throws Exception
ipAddress - The ipAddress of the clientsender - The mailFromrecip - The rcptToExceptionprotected abstract void insertTriplet(String ipAddress, String sender, String recip, int count, long createTime) throws Exception
ipAddress - The ipAddress of the clientsender - The mailFromrecip - The rcptTocount - The countcreateTime - The createTimeSQLExceptionExceptionprotected abstract void updateTriplet(String ipAddress, String sender, String recip, int count, long time) throws Exception
ipAddress - The ipAddress of the clientsender - The mailFromrecip - The rcptTocount - The counttime - the current time in msExceptionprotected abstract void cleanupAutoWhiteListGreyList(long time)
throws Exception
time - The time which must be reached before delete the recordsExceptionprotected abstract void cleanupGreyList(long time)
throws Exception
time - The time which must be reached before delete the recordsExceptionpublic 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.