de.malowa.suggestions.delay
Class SenderSpecificRule

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

public class SenderSpecificRule
extends java.lang.Object
implements DelayRule

Prefers mails coming from "good" top level domains and harms mails form "bad" top level domains. The top level domain is extracted from the sender's hostname.

Author:
Marcel Lohmann

Constructor Summary
SenderSpecificRule()
          Creates the 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

SenderSpecificRule

public SenderSpecificRule()
Creates the 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()