org.apache.james.transport.mailets
Class UsersRepositoryAliasingForwarding

java.lang.Object
  extended by org.apache.mailet.GenericMailet
      extended by org.apache.james.transport.mailets.UsersRepositoryAliasingForwarding
All Implemented Interfaces:
Mailet, MailetConfig

public class UsersRepositoryAliasingForwarding
extends GenericMailet

Receives a Mail from JamesSpoolManager and takes care of delivery of the message to local inboxes. Available configurations are: true: specify wether the user aliases should be looked up or not. Default is false. true: enable the forwarding. Default to false. LocalAdmins: specific users repository name. Default to empty. If empty does lookup the default userRepository.


Constructor Summary
UsersRepositoryAliasingForwarding()
           
 
Method Summary
 java.lang.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).
 java.lang.String processMail(MailAddress sender, MailAddress recipient, javax.mail.internet.MimeMessage message)
          Return null when the mail should be GHOSTed, the username string when it should be changed due to the ignoreUser configuration.
 void service(Mail mail)
          Delivers a mail to a local mailbox.
 
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

UsersRepositoryAliasingForwarding

public UsersRepositoryAliasingForwarding()
Method Detail

service

public void service(Mail mail)
             throws javax.mail.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:
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 Mailet
Overrides:
getMailetInfo in class GenericMailet
Returns:
a string describing this mailet

processMail

public java.lang.String processMail(MailAddress sender,
                                    MailAddress recipient,
                                    javax.mail.internet.MimeMessage message)
                             throws javax.mail.MessagingException
Return null when the mail should be GHOSTed, the username string when it should be changed due to the ignoreUser configuration.

Parameters:
sender -
recipient -
message -
Throws:
javax.mail.MessagingException

init

public void init()
          throws javax.mail.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:
javax.mail.MessagingException - if an exception occurs that interrupts the mailet's normal operation
See Also:
GenericMailet.init()


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.