Mailet Container Configuration

Consult mailetcontainer-template.xml in SVN to get some examples and hints.

Changes between 3.0-M2 and 3.0-beta3:

  • No more mailetpackage specification in mailetcontainer.xml
  • Exactly one standard package, hard-coded in source code
  • Standard package applied to mailet classnames without package prefix
  • All custom mailets must be specified with full package prefix
  • Package prefixed custom mailet names will be searched across the entire applicable class path
  • Composite matchers

This configuration block is defined by the mailserver tag. All administrators need to adjust the mailserver block upon installation.

The body of this element is the address that the server will consider its postmaster address. This address will be listed as the sender address of all error messages that originate from James. Also, all messages addressed to postmaster@<servername>, where <servername> is one of the domain names whose mail is being handled by James, will be redirected to this email address. Set this to the appropriate email address for error reports If this is set to a non-local email address, the mail server will still function, but will generate a warning on startup.
Number of simultaneous threads used to spool the mails.

The Mailet Tag

Consider the following simple mailet tag:

<mailet match="RemoteAddrNotInNetwork=" class="ToProcessor">

The mailet tag has two required attributes, match and class.

The match attribute is set to the value of the specific Matcher class to be instantiated with a an optional argument. If present, the argument is separated from the Matcher class name by an '='. Semantic interpretation of the argument is left to the particular mailet.

The class attribute is set to the value of the Mailet class that is to be instantiated.

Finally, the children of the mailet tag define the configuration that is passed to the Mailet. The tags used in this section should have no attributes or children. The names and bodies of the elements will be passed to the mailet as (name, value) pairs.

So in the example above, a Matcher instance of RemoteAddrNotInNetwork would be instantiated, and the value "" would be passed to the matcher. The Mailet of the pair will be an instance of ToProcessor, and it will be passed the (name, value) pair of ("processor", "spam").

Apache James Server includes a number of pre-packaged Mailets and Matchers. A list of provided Mailets may be found here. A list of provided Matchers may be found here.