The Apache Mailet API is a Java API which allows the rapid development and flexible deployment of email processing functionality.
The Mailet API is a subproject of Apache JAMES. All who are interested in developing the Mailet API and JAMES will be warmly welcomed on the mailing lists.
Apache Mailet 2.4 is the current release and can be downloaded here.
2.4 is the first independent release of the API. Earlier versions were released as part of the Apache James Server and are versioned accordingly. 2.4 differs from the last version shipped (with Server 2.3) only by minor bug fixes and is compatible with it.
A small number of methods were added to the Mailet API version in the 2.3.2
codestream after 2.3.1 but before Mailet API release 2.4. If
these methods are used then apache-mailet-2.4.jar must be inserted into
the startup classpath before the main server classes.
Some useful development classes bundled with 2.3.1 are now available
as the independent Mailet Base Tookit.
A mailet is a mail processing component. Though there are some differences, a servlet as a HTTP processing component is a useful analogy.
Mailets implement Mailet. Mailets execute within a mailet container. JAMES server is a well known mailet container. Assembly and configuration of mailets and mail processors is the responsibility of the particular container.
Mailets have a simple lifecycle managed by the mailet container:
init(MailetConfig config) passes
environmental information. Any setup necessary should be performed now.service(Mail mail) is called
repeatedly. Note that this method may be called concurrently.destroy() is called when the mailet is taken
out of service.getInitParameter allows configuration parameters to be passed from the mailet container.
How these parameters are set by the user of the mailet is the responsibility of the container.
More sophisticated configuration and assembly (for example, allowing access to services) is also the
responsibility of the container.
See Standard mailets.
The build uses Ant. ant -projecthelp
describes appropriate targets. ant runs the default target.
Please direct your feedback to the mailet-api mailing list.