com.hs.mail.mailet
Class RemoteDelivery

java.lang.Object
  extended by com.hs.mail.mailet.AbstractMailet
      extended by com.hs.mail.mailet.RemoteDelivery
All Implemented Interfaces:
Mailet

public class RemoteDelivery
extends AbstractMailet

Receives a Mail from SmtpMessageConsumer and takes care of delivery of the message to remote hosts. If for some reason mail can't be delivered store it with undelivered recipients and current retry count in the "spool" repository. After the next "retryDelayTime" the SpoolRepository will try to send it again. After "maxRetries" the mail will be considered undeliverable and will be returned to sender.

Since:
Jun 7, 2010
Author:
Won Chul Doh

Field Summary
 
Fields inherited from class com.hs.mail.mailet.AbstractMailet
context
 
Constructor Summary
RemoteDelivery()
           
 
Method Summary
 boolean accept(Set<Recipient> recipients, SmtpMessage message)
          Check if the mailet is interested in the given recipients and message.
static Iterator<HostAddress> getSmtpHostAddress(String domainName)
           
 void init(MailetContext context)
          Initialize the mailet
static void removeAll(Collection<Recipient> recipients, javax.mail.Address[] addresses)
           
 void service(Set<Recipient> recipients, SmtpMessage message)
          For this message, we take the list of recipients, organize these into distinct servers, and deliver the message for each of these servers.
 void setDebug(boolean debug)
           
 
Methods inherited from class com.hs.mail.mailet.AbstractMailet
getMailboxManager, getUserManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteDelivery

public RemoteDelivery()
Method Detail

setDebug

public void setDebug(boolean debug)

init

public void init(MailetContext context)
Initialize the mailet

Specified by:
init in interface Mailet
Overrides:
init in class AbstractMailet

accept

public boolean accept(Set<Recipient> recipients,
                      SmtpMessage message)
Description copied from interface: Mailet
Check if the mailet is interested in the given recipients and message. If this method returns false, the service method will not be called for this message.

Specified by:
accept in interface Mailet
Overrides:
accept in class AbstractMailet
Parameters:
recipients - collection of recipients this mailet must process
message - the Mail object that contains the message and routing information
Returns:
true if the mailet want to process the message, otherwise false

service

public void service(Set<Recipient> recipients,
                    SmtpMessage message)
             throws javax.mail.MessagingException
For this message, we take the list of recipients, organize these into distinct servers, and deliver the message for each of these servers.

Specified by:
service in interface Mailet
Specified by:
service in class AbstractMailet
Parameters:
recipients - collection of recipients this mailet must process
message - the Mail object that contains the message and routing information
Throws:
javax.mail.MessagingException

getSmtpHostAddress

public static Iterator<HostAddress> getSmtpHostAddress(String domainName)

removeAll

public static void removeAll(Collection<Recipient> recipients,
                             javax.mail.Address[] addresses)


Copyright © 2011. All Rights Reserved.