public class JDBCGreylistHandler extends org.apache.james.protocols.smtp.core.fastfail.AbstractGreylistHandler implements InitializingLifecycleAwareProtocolHandler
Constructor and Description |
---|
JDBCGreylistHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanupAutoWhiteListGreyList(long time) |
protected void |
cleanupGreyList(long time) |
void |
destroy() |
org.apache.james.protocols.smtp.hook.HookResult |
doRcpt(org.apache.james.protocols.smtp.SMTPSession session,
org.apache.james.protocols.smtp.MailAddress sender,
org.apache.james.protocols.smtp.MailAddress rcpt) |
FileSystem |
getFileSystem()
Gets the file system service.
|
protected Iterator<String> |
getGreyListData(String ipAddress,
String sender,
String recip) |
protected NetMatcher |
getWhiteListedNetworks() |
void |
init(org.apache.commons.configuration.Configuration handlerConfiguration)
Init with the given
Configuration |
protected void |
insertTriplet(String ipAddress,
String sender,
String recip,
int count,
long createTime) |
void |
setAutoWhiteListLifeTime(String autoWhiteListLifeTime)
Setup the autowhitelist lifetime for which we should whitelist a triplet.
|
void |
setDataSource(DataSource datasource)
Set the datasources.
|
void |
setDNSService(DNSService dnsService) |
void |
setFileSystem(FileSystem system)
Sets the filesystem service
|
void |
setLog(org.slf4j.Logger log) |
void |
setSqlFileUrl(String sqlFileUrl)
Set the sqlFileUrl to use for getting the sqlRessource.xml file
|
void |
setTempBlockTime(String tempBlockTime)
Setup the temporary blocking time
|
void |
setUnseenLifeTime(String unseenLifeTime)
Set up the liftime of only once seen triplet.
|
void |
setWhiteListedNetworks(NetMatcher wNetworks) |
protected void |
updateTriplet(String ipAddress,
String sender,
String recip,
int count,
long time) |
public final FileSystem getFileSystem()
public void setFileSystem(FileSystem system)
system
- The filesystem servicepublic void setDataSource(DataSource datasource)
datasource
- The datasourcepublic void setSqlFileUrl(String sqlFileUrl)
sqlFileUrl
- The fileUrlpublic void setTempBlockTime(String tempBlockTime)
tempBlockTime
- The temporary blocking timepublic void setAutoWhiteListLifeTime(String autoWhiteListLifeTime)
autoWhiteListLifeTime
- The lifeTimepublic void setUnseenLifeTime(String unseenLifeTime)
unseenLifeTime
- The lifetimepublic final void setDNSService(DNSService dnsService)
public void setWhiteListedNetworks(NetMatcher wNetworks)
protected NetMatcher getWhiteListedNetworks()
protected Iterator<String> getGreyListData(String ipAddress, String sender, String recip) throws SQLException
getGreyListData
in class org.apache.james.protocols.smtp.core.fastfail.AbstractGreylistHandler
SQLException
AbstractGreylistHandler.getGreyListData(java.lang.String,
java.lang.String, java.lang.String)
protected void insertTriplet(String ipAddress, String sender, String recip, int count, long createTime) throws SQLException
insertTriplet
in class org.apache.james.protocols.smtp.core.fastfail.AbstractGreylistHandler
SQLException
AbstractGreylistHandler.insertTriplet(java.lang.String,
java.lang.String, java.lang.String, int, long)
protected void updateTriplet(String ipAddress, String sender, String recip, int count, long time) throws SQLException
updateTriplet
in class org.apache.james.protocols.smtp.core.fastfail.AbstractGreylistHandler
SQLException
AbstractGreylistHandler.updateTriplet(java.lang.String,
java.lang.String, java.lang.String, int, long)
protected void cleanupAutoWhiteListGreyList(long time) throws SQLException
cleanupAutoWhiteListGreyList
in class org.apache.james.protocols.smtp.core.fastfail.AbstractGreylistHandler
SQLException
AbstractGreylistHandler.cleanupAutoWhiteListGreyList(long)
protected void cleanupGreyList(long time) throws SQLException
cleanupGreyList
in class org.apache.james.protocols.smtp.core.fastfail.AbstractGreylistHandler
SQLException
AbstractGreylistHandler.cleanupGreyList(long)
public org.apache.james.protocols.smtp.hook.HookResult doRcpt(org.apache.james.protocols.smtp.SMTPSession session, org.apache.james.protocols.smtp.MailAddress sender, org.apache.james.protocols.smtp.MailAddress rcpt)
doRcpt
in interface org.apache.james.protocols.smtp.hook.RcptHook
doRcpt
in class org.apache.james.protocols.smtp.core.fastfail.AbstractGreylistHandler
org.apache.james.protocols.smtp.core.fastfail.AbstractGreylistHandler#doRcpt(org.apache.james.protocols.smtp.SMTPSession,
org.apache.mailet.MailAddress, org.apache.mailet.MailAddress)
public void setLog(org.slf4j.Logger log)
LogEnabled.setLog(Logger)
public void init(org.apache.commons.configuration.Configuration handlerConfiguration) throws org.apache.commons.configuration.ConfigurationException
InitializingLifecycleAwareProtocolHandler
Configuration
init
in interface InitializingLifecycleAwareProtocolHandler
org.apache.commons.configuration.ConfigurationException
public void destroy()
destroy
in interface org.apache.james.protocols.api.handler.LifecycleAwareProtocolHandler
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.