org.apache.james.transport.mailets
Class XMLVirtualUserTable

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

public class XMLVirtualUserTable
extends AbstractVirtualUserTable

Implements a Virtual User Table to translate virtual users to real users. This implementation has the same functionality as JDBCVirtualUserTable, but is configured in the JAMES configuration and is thus probably most suitable for smaller and less dynamic mapping requirements. The configuration is specified in the form: <mailet match="All" class="XMLVirtualUserTable"> <mapping>virtualuser@xxx=realuser[@yyy][;anotherrealuser[@zzz]]</mapping> <mapping>virtualuser2@*=realuser2[@yyy][;anotherrealuser2[@zzz]]</mapping> ... </mailet> As many <mapping> elements can be added as necessary. As indicated, wildcards are supported, and multiple recipients can be specified with a semicolon-separated list. The target domain does not need to be specified if the real user is local to the server. Matching is done in the following order: 1. user@domain - explicit mapping for user@domain 2. user@* - catchall mapping for user anywhere 3. *@domain - catchall mapping for anyone at domain 4. null - no valid mapping


Constructor Summary
XMLVirtualUserTable()
           
 
Method Summary
 java.lang.String getMailetInfo()
          Returns information about the mailet, such as author, version, and copyright.
 void init()
          Initialize the mailet
protected  void mapRecipients(java.util.Map recipientsMap)
          Map any virtual recipients to real recipients using the configured mapping.
 
Methods inherited from class org.apache.james.transport.mailets.AbstractVirtualUserTable
service
 
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

XMLVirtualUserTable

public XMLVirtualUserTable()
Method Detail

init

public void init()
          throws javax.mail.MessagingException
Initialize the mailet

Overrides:
init in class GenericMailet
Throws:
javax.mail.MessagingException - if an exception occurs that interrupts the mailet's normal operation

mapRecipients

protected void mapRecipients(java.util.Map recipientsMap)
                      throws javax.mail.MessagingException
Map any virtual recipients to real recipients using the configured mapping.

Specified by:
mapRecipients in class AbstractVirtualUserTable
Parameters:
recipientsMap - the mapping of virtual to real recipients
Throws:
javax.mail.MessagingException

getMailetInfo

public java.lang.String getMailetInfo()
Description copied from class: GenericMailet
Returns information about the mailet, such as author, version, and copyright. By default, this method returns an empty string. Override this method to have it return a meaningful value.

Specified by:
getMailetInfo in interface Mailet
Overrides:
getMailetInfo in class GenericMailet
Returns:
information about this mailet, by default an empty string


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