de.malowa.greylister.trap
Class SpamTrap

java.lang.Object
  extended by de.malowa.greylister.trap.SpamTrap
Direct Known Subclasses:
ConcreteSpamTrap, NoSpamTrap

public abstract class SpamTrap
extends java.lang.Object

A SpamTrap can be used to redirect spam arriving on a several email addresses or domains.

Author:
Marcel Lohmann

Constructor Summary
SpamTrap()
           
 
Method Summary
abstract  void cleanUp()
          Cleans expired entries of spam trap occurrences.
abstract  java.lang.String getAction(java.lang.String recipient)
          Action to be performed when mail is sent to a spam trap.
abstract  boolean isSpamLover(java.lang.String recipient)
          Returns true, if the recipient's email address or email domain is defined as spam trap
abstract  boolean sentSpamLately(SMTPInformation smptInformation)
          Stops redirecting when a defined amount of spam arrives from a given IP in a given period of time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpamTrap

public SpamTrap()
Method Detail

sentSpamLately

public abstract boolean sentSpamLately(SMTPInformation smptInformation)
Stops redirecting when a defined amount of spam arrives from a given IP in a given period of time. It is not necessary to redirect too much spam to final recipient.

Parameters:
smptInformation - data containing the spammer's IP
Returns:
true when there was too much spam originating from an IP

cleanUp

public abstract void cleanUp()
Cleans expired entries of spam trap occurrences.


isSpamLover

public abstract boolean isSpamLover(java.lang.String recipient)
Returns true, if the recipient's email address or email domain is defined as spam trap

Parameters:
recipient - email address
Returns:
true if the recipient or domain is a spam trap

getAction

public abstract java.lang.String getAction(java.lang.String recipient)
Action to be performed when mail is sent to a spam trap. See postfix's access(5) manual page.

Parameters:
recipient - address of spam trap
Returns:
action for postfix to perform