de.malowa.rules.delay
Interface DelayRule

All Known Implementing Classes:
ClientCountryDomainRule, DefaultDelayRule, HeloWithoutDotRule, HostNotGivenRule, OptimisticDelay, SenderSpecificRule

public interface DelayRule

Is used to determine the delay time in minutes a mail server has to wait before passing the greylisting. The delay time of (all) GreylistRules is added. The resulting delay is written to the greylist database. For runtime performance a DelayRule should calculate the delay time in memory without retrieving data from external sources. Therefore the necessary data should be read while initializing the rule. The method update() will be called regularly to reread this data. The in memory calculation is not mandantory. See RuleEvaluator on how to integrate your own rules to the program. See de.malowa.suggestions.delay for working and usable examples.

Author:
Marcel Lohmann (marcel@malowa.de)

Method Summary
 int getDelayTime(SMTPInformation mail)
          Returns the delay in minutes for the given SMTP mail header.
 int getDelayTimeWithHistory(SMTPInformation info, MailHistory history)
          Returns the delay in minutes for the given SMTP mail header.
 void update()
          Will be called regularly.
 

Method Detail

getDelayTime

int getDelayTime(SMTPInformation mail)
Returns the delay in minutes for the given SMTP mail header. Will be used for calculation of initial delay while inserting into greylist database.

Parameters:
mail - SMTP information to utilize
Returns:
minutes to delay. May be zero or negative

getDelayTimeWithHistory

int getDelayTimeWithHistory(SMTPInformation info,
                            MailHistory history)
Returns the delay in minutes for the given SMTP mail header. Will be used for calculation of further delay when SMTP header is already known to the greylist database. May delegate to getDelayTime(SMTPInformation) without considering history.

Parameters:
info - SMTP information to utilize
history - the history of past delivery attempts to utilize
Returns:
minutes to delay. May be zero or negative

update

void update()
Will be called regularly. Can be used to reread any necessary data for calculation.