org.apache.james.transport.mailets
Class ToMultiRepository
java.lang.Object
org.apache.mailet.base.GenericMailet
org.apache.james.transport.mailets.ToMultiRepository
- All Implemented Interfaces:
- org.apache.mailet.Mailet, org.apache.mailet.MailetConfig
public class ToMultiRepository
- extends org.apache.mailet.base.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 or the full recipient address, depending on the configuration
(repositorySelector).
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
defaults to "localpart" and can be changed to "full" if you
prefer to use full recipient emails as repository names.
Method Summary |
java.lang.String |
getId()
Return a new mail id. |
java.lang.String |
getMailetInfo()
Return a string describing this mailet. |
void |
init()
|
void |
service(org.apache.mailet.Mail mail)
Delivers a mail to a local mailbox. |
void |
storeMail(org.apache.mailet.MailAddress sender,
org.apache.mailet.MailAddress recipient,
javax.mail.internet.MimeMessage message)
|
Methods inherited from class org.apache.mailet.base.GenericMailet |
arrayToString, checkInitParameters, destroy, getInitParameter, 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 |
ToMultiRepository
public ToMultiRepository()
service
public void service(org.apache.mailet.Mail mail)
throws javax.mail.MessagingException
- Delivers a mail to a local mailbox.
- Specified by:
service
in interface org.apache.mailet.Mailet
- Specified by:
service
in class org.apache.mailet.base.GenericMailet
- Parameters:
mail
- the mail being processed
- Throws:
javax.mail.MessagingException
- if an error occurs while storing the mail
getMailetInfo
public java.lang.String getMailetInfo()
- Return a string describing this mailet.
- Specified by:
getMailetInfo
in interface org.apache.mailet.Mailet
- Overrides:
getMailetInfo
in class org.apache.mailet.base.GenericMailet
- Returns:
- a string describing this mailet
storeMail
public void storeMail(org.apache.mailet.MailAddress sender,
org.apache.mailet.MailAddress recipient,
javax.mail.internet.MimeMessage message)
throws javax.mail.MessagingException
- Parameters:
sender
- recipient
- message
-
- Throws:
javax.mail.MessagingException
getId
public java.lang.String getId()
- Return a new mail id.
- Returns:
- a new mail id
init
public void init()
throws javax.mail.MessagingException
- Overrides:
init
in class org.apache.mailet.base.GenericMailet
- Throws:
javax.mail.MessagingException
- See Also:
org.apache.mailet.GenericMailet#init()
Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.