GlassFish Project - JavaMail home page

New to GlassFish | Community Guidelines | Downloads | FAQ | How-Tos | JavaMail Home

This is the home page for the JavaMail implementation in GlassFish. The JavaMail API provides a platform-independent and protocol-independent framework to build mail and messaging applications. The JavaMail API is implemented as a Java platform optional package and is also available as part of the Java platform, Enterprise Edition. All Java EE application servers, including GlassFish, provide an implementation of the JavaMail API. The JavaMail implementation in GlassFish is the source code from which the JavaMail reference implementation is built. Many other application servers use the same JavaMail reference implementation.

You'll find JavaMail users on the mailing list. Instructions on how to subscribe are on the JavaMail home page. You can reach the JavaMail development team directly at, which is the best place to report bugs (for now). You can also find and report bugs using the Sun Bug Database in the JavaMail category. Questions and discussion around the JavaMail source code can be sent to the general GlassFish developers mailing list,, or directly to the JavaMail development team within Sun at Finally, be sure to read the JavaMail FAQ.

JavaMail makes use of the JavaBeans Activation Framework (JAF). JAF is also included in GlassFish and will be in Java SE 6 (Mustang) as well.

JavaMail News

JavaMail 1.4.1 and JAF 1.1.1 have been released and are included with GlassFish V2.

Older News

JavaMail is now part of the open source GlassFish project!

Page Contents

JavaMail Technologies

The majority of the GlassFish code is available under the Common Development and Distribution License (CDDL) v1.0  The following page contains details about the components in GlassFish and the licenses under which they are covered.

The JavaMail code is contained in the mail module. The JAF code is contained in the activation module.

JavaMail was originally written for JDK 1.1 and because of that the source code doesn't make use of many features in newer versions of the JDK. Some support for new features is provided conditionally using reflection so that the code will still compile and run on JDK 1.1.

JavaMail is widely used outside of Java EE application servers so it is important that JavaMail continue to work on older releases of the JDK. With JavaMail 1.4, we've moved the minimum release to be J2SE 1.4, so JavaMail can directly take advantage of J2SE 1.4 features. We'll be updating the code slowly to make this change and remove most uses of reflection. JavaMail source code must still not make direct use of J2SE 5.0 or newer features, which impacts its use of the SASL API.

GlassFish includes JAF 1.1, which is the only significant update to JAF in the last eight years. In general, JAF is not being actively developed.

Unit/Acceptance Tests

Like all Java technologies, JavaMail and JAF implementations must pass the corresponding TCK before final release. In addition, we have some ad hoc unit tests that we use to test individual features and to stress test JavaMail. We'll be making some of these available as soon as possible.

Supporting Documentation

This sections contains pointers to useful documents and information about the JavaMail technology in GlassFish.


General information:

There's lots of good general information about JavaMail on the JavaMail home page.

Checking out and building the code

If you want to build Glassfish, follow these instructions. However, you can also build JavaMail or JAF separately.

Each module repository is tagged so you can checkout and build individual distributions equivalent to those used for JavaMail 1.4.1 and/or JAF 1.1.1. The cvs tags are as follows:



  1. Checkout the glassfish bootstrap module.  This module is required by the JAF and JavaMail module build scripts.
    1. % mkdir workspace
      % cd workspace
      % cvs -d :pserver:<userid> checkout -r SJSAS-9_1-B58G-FCS-08_Sept_2007 glassfish/bootstrap
  2. Checkout and build JAF 1.1.1.
    1. % cvs -d :pserver:<userid> checkout -r JAF-1_1_1 glassfish/activation
      % cd glassfish/activation
      % ant release
  3. Checkout and build JavaMail 1.4.1.
    1. % cvs -d :pserver:<userid> checkout -r JAVAMAIL-1_4_1 glassfish/mail
      % cd glassfish/mail
      % ant release
  4. Build output:  The finished jars can be found in the respective build/release folders (glassfish/mail/build/release and glassfish/activation/build/release).  There is also a zip archive containing the full distribution including javadocs, release notes, etc. created in the root of each source tree.

ToDo List

Eventually we'll move our list of things to do to Issue tracker so everyone can figure out what needs to be done. Until then, here's the top items on the list:

The ToDo list will be maintained using Issue Tracker Task issue type. You can query Issue Tracker using issue type Task or click here to check out the ToDo list.

Of course, the To Do list implicitly includes all the bugs and RFEs reported against JavaMail, which you can find here.