org.apache.james.transport.mailets
Class ToMultiRepository

java.lang.Object
  extended byorg.apache.mailet.GenericMailet
      extended byorg.apache.james.transport.mailets.ToMultiRepository
All Implemented Interfaces:
Mailet, MailetConfig

public class ToMultiRepository
extends GenericMailet

Receives a Mail from JamesSpoolManager and takes care of delivery of the message to local inboxes or a specific repository. Differently from LocalDelivery this does not lookup the UserRepository This simply store the message in a repository named like the local part of the recipient address. If no repository is specified then this fallback to MailServer.getUserInbox. Otherwise you can add your own configuration for the repository e.g: file://var/spool/userspools/ SPOOL file://var/mail/inboxes/ MAIL Header "Delivered-To" can be added to every message adding the Delivered-To


Constructor Summary
ToMultiRepository()
           
 
Method Summary
 String getId()
          Return a new mail id.
 String getMailetInfo()
          Return a string describing this mailet.
 void init()
          A convenience method which can be overridden so that there's no need to call super.init(config).
 void service(Mail mail)
          Delivers a mail to a local mailbox.
 void storeMail(MailAddress sender, MailAddress recipient, MimeMessage message)
           
 
Methods inherited from class org.apache.mailet.GenericMailet
destroy, getInitParameter, getInitParameter, getInitParameterNames, getMailetConfig, getMailetContext, getMailetName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToMultiRepository

public ToMultiRepository()
Method Detail

service

public void service(Mail mail)
             throws MessagingException
Delivers a mail to a local mailbox.

Specified by:
service in interface Mailet
Specified by:
service in class GenericMailet
Parameters:
mail - the mail being processed
Throws:
MessagingException - if an error occurs while storing the mail

getMailetInfo

public String getMailetInfo()
Return a string describing this mailet.

Specified by:
getMailetInfo in interface Mailet
Overrides:
getMailetInfo in class GenericMailet
Returns:
a string describing this mailet

storeMail

public void storeMail(MailAddress sender,
                      MailAddress recipient,
                      MimeMessage message)
               throws MessagingException
Parameters:
sender -
recipient -
message -
Throws:
MessagingException

getId

public String getId()
Return a new mail id.

Returns:
a new mail id

init

public void init()
          throws MessagingException
Description copied from class: GenericMailet

A convenience method which can be overridden so that there's no need to call super.init(config).

Instead of overriding init(MailetConfig), simply override this method and it will be called by GenericMailet.init(MailetConfig config). The MailetConfig object can still be retrieved via getMailetConfig().

Overrides:
init in class GenericMailet
Throws:
MessagingException - if an exception occurs that interrupts the mailet's normal operation
See Also:
GenericMailet.init()


"Copyright © 1999-2006 Apache Jakarta Project. All Rights Reserved."