de.malowa.suggestions.delay
Class ClientCountryDomainRule

java.lang.Object
  extended by de.malowa.suggestions.delay.ClientCountryDomainRule
All Implemented Interfaces:
DelayRule

public class ClientCountryDomainRule
extends java.lang.Object
implements DelayRule

Defines a rule that prefers messages originating from some countries and harms messages from other countries. The countries will be determined by the top level domain from the sending host.

Author:
Marcel Lohmann

Constructor Summary
ClientCountryDomainRule()
          Constructor of rule
 
Method Summary
 int getDelayTime(SMTPInformation info)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientCountryDomainRule

public ClientCountryDomainRule()
Constructor of rule

Method Detail

getDelayTime

public int getDelayTime(SMTPInformation info)
Description copied from interface: DelayRule
Returns the delay in minutes for the given SMTP mail header. Will be used for calculation of initial delay while inserting into greylist database.

Specified by:
getDelayTime in interface DelayRule
Parameters:
info - SMTP information to utilize
Returns:
minutes to delay. May be zero or negative
See Also:
DelayRule.getDelayTime(de.malowa.greylister.SMTPInformation)

getDelayTimeWithHistory

public int getDelayTimeWithHistory(SMTPInformation info,
                                   MailHistory history)
Description copied from interface: DelayRule
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 DelayRule.getDelayTime(SMTPInformation) without considering history.

Specified by:
getDelayTimeWithHistory in interface DelayRule
Parameters:
info - SMTP information to utilize
history - the history of past delivery attempts to utilize
Returns:
minutes to delay. May be zero or negative
See Also:
DelayRule.getDelayTimeWithHistory(de.malowa.greylister.SMTPInformation, de.malowa.greylister.MailHistory)

update

public void update()
Description copied from interface: DelayRule
Will be called regularly. Can be used to reread any necessary data for calculation.

Specified by:
update in interface DelayRule
See Also:
DelayRule.update()