de.malowa.greylister
Class Greylister

java.lang.Object
  extended by de.malowa.greylister.Greylister
All Implemented Interfaces:
StateVisitor

public class Greylister
extends java.lang.Object
implements StateVisitor

The Greylister is the interface to the database layer which holds and stores all information of the current email delivery attempt. It is able to determines the current state in which the current delivery attempt is in. It also can transform the state to the next state and store that information in the database.

Author:
Administrator

Constructor Summary
Greylister(SMTPInformation info)
          Constructs a new interface to the database layer.
 
Method Summary
 State getState()
          Returns the state the current delivery attempt is in.
 void handleBlockBeforeGreylist(BlockBeforeGreylistState blockBeforeGreylistState)
          Callback function when the delivery attempt should be rejected as it is on a calculated blacklist.
 void handleNotOnGreylist(NotOnGreylistState visitee)
          Callback function when the delivery attempt should be deferred as it has not been seen before.
 void handleOnWhitelist(OnWhitelistState visitee)
          Callback function when the delivery attempt should be accepted as it is on the internal whitelist.
 void handlePassBeforeGreylist(PassBeforeGreylistState visitee)
          Callback function when the delivery attempt should be accepted as it is on a calculated whitelist.
 void handlePassedGreylist(PassedGreylistState visitee)
          Callback function when the delivery attempt should be accepted as it has passed the greylisting.
 void handlePassWhileGreylisted(PassWhileGreylistedState visitee)
          Callback function when the delivery attempt should be accepted as it is on a calculated whitelist.
 void handleStillDelayed(StillDelayedState visitee)
          Callback function when the delivery attempt should be deferred again as its delay time has not passed, yet.
 void transitionToNextState()
          Based on the current state the state will be transformed to the next state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Greylister

public Greylister(SMTPInformation info)
Constructs a new interface to the database layer.

Parameters:
info - information from SMTP connection to determine the current state of the current delivery attempt.
Method Detail

getState

public State getState()
Returns the state the current delivery attempt is in. The state will not change even if transitionToNextState() is called.

Returns:
the evaluated state from database or rules.

handleBlockBeforeGreylist

public final void handleBlockBeforeGreylist(BlockBeforeGreylistState blockBeforeGreylistState)
Description copied from interface: StateVisitor
Callback function when the delivery attempt should be rejected as it is on a calculated blacklist. That means that there are strong indications that the delivery attempt originates from a spamming source.

Specified by:
handleBlockBeforeGreylist in interface StateVisitor
Parameters:
blockBeforeGreylistState - the state contains all information of the delivery attempt.
See Also:
StateVisitor.handleBlockBeforeGreylist(de.malowa.state.BlockBeforeGreylistState)

handleNotOnGreylist

public final void handleNotOnGreylist(NotOnGreylistState visitee)
Description copied from interface: StateVisitor
Callback function when the delivery attempt should be deferred as it has not been seen before. The attempt will be documented for ongoing delivery attempts.

Specified by:
handleNotOnGreylist in interface StateVisitor
Parameters:
visitee - the state contains all information of the delivery attempt.
See Also:
StateVisitor.handleNotOnGreylist(de.malowa.state.NotOnGreylistState)

handleOnWhitelist

public final void handleOnWhitelist(OnWhitelistState visitee)
Description copied from interface: StateVisitor
Callback function when the delivery attempt should be accepted as it is on the internal whitelist.

Specified by:
handleOnWhitelist in interface StateVisitor
Parameters:
visitee - the state contains all information of the delivery attempt.
See Also:
StateVisitor.handleOnWhitelist(de.malowa.state.OnWhitelistState)

handlePassBeforeGreylist

public final void handlePassBeforeGreylist(PassBeforeGreylistState visitee)
Description copied from interface: StateVisitor
Callback function when the delivery attempt should be accepted as it is on a calculated whitelist. That means that the delivery attempt should not be delayed at all and must not pass greylisting.

Specified by:
handlePassBeforeGreylist in interface StateVisitor
Parameters:
visitee - the state contains all information of the delivery attempt.
See Also:
StateVisitor.handlePassBeforeGreylist(de.malowa.state.PassBeforeGreylistState)

handlePassedGreylist

public final void handlePassedGreylist(PassedGreylistState visitee)
Description copied from interface: StateVisitor
Callback function when the delivery attempt should be accepted as it has passed the greylisting. In other words the delay time has passed.

Specified by:
handlePassedGreylist in interface StateVisitor
Parameters:
visitee - the state contains all information of the delivery attempt.
See Also:
StateVisitor.handlePassedGreylist(de.malowa.state.PassedGreylistState)

handlePassWhileGreylisted

public final void handlePassWhileGreylisted(PassWhileGreylistedState visitee)
Description copied from interface: StateVisitor
Callback function when the delivery attempt should be accepted as it is on a calculated whitelist. That means that the delay time has not been passed but other indications show that it would pass in the future.

Specified by:
handlePassWhileGreylisted in interface StateVisitor
Parameters:
visitee - the state contains all information of the delivery attempt.
See Also:
StateVisitor.handlePassWhileGreylisted(de.malowa.state.PassWhileGreylistedState)

handleStillDelayed

public final void handleStillDelayed(StillDelayedState visitee)
Description copied from interface: StateVisitor
Callback function when the delivery attempt should be deferred again as its delay time has not passed, yet.

Specified by:
handleStillDelayed in interface StateVisitor
Parameters:
visitee - the state contains all information of the delivery attempt.
See Also:
StateVisitor.handleStillDelayed(de.malowa.state.StillDelayedState)

transitionToNextState

public final void transitionToNextState()
Based on the current state the state will be transformed to the next state. The new information is then written to the database.