Sun logo      Previous      Contents      Next     

Sun Java System Application Server Enterprise Edition 8.1 Administration Guide 2005Q1

Chapter 9
Configuring JavaMail Resources

This chapter describes how to configure resources for applications that use the JavaMail API. It contains the following sections:


About JavaMail

The JavaMail API

The JavaMail API is a set of abstract APIs that model a mail system. The API provides a platform-independent and protocol-independent framework to build mail and messaging applications. The JavaMail API provides facilities for reading and sending email. Service providers implement particular protocols.

The JavaMail API is implemented as a Java platform optional package and is also available as part of the J2EE platform.

The Application Server includes the JavaMail API along with JavaMail service providers that allow an application component to send email notifications over the Internet and to read email from IMAP and POP3 mail servers.

For more information about the JavaMail API, go to the JavaMail website (http://java.sun.com/products/javamail/).


Admin Console Tasks for JavaMail

Creating a JavaMail Session

To create a JavaMail session, follow these steps:

  1. In the tree component, expand the Resources node, then select the JavaMail Sessions node.
  2. On the JavaMail Sessions page, click New. The Create JavaMail Session page appears.
  3. In the JNDI Name field, type the name of the session. For example:
  4. mail/MySession

    It is a recommended practice to use the naming subcontext prefix mail/ for JavaMail resources.

  5. In the Mail Host field, type the host name of the default mail server. The connect methods of the Store and Transport objects use this value if a protocol-specific host property is not supplied. The name must be resolvable to an actual host name.
  6. In the Default User field, type the user name to provide when connecting to a mail server. The connect methods of the Store and Transport objects use this value if a protocol-specific username property is not supplied.
  7. In the Default Return Address field, type the email address of the default user, in the form username@host.domain.
  8. Deselect the Enabled checkbox if you do not want to enable the mail session at this time.
  9. In the Advanced area, change the field values only if the Application Server’s mail provider has been reconfigured to use a nondefault store or transport protocol. By default, the Store Protocol is imap; the Store Protocol Class is com.sun.mail.imap.IMAPStore; the Transport Protocol is smtp; and the Transport Protocol Class is com.sun.mail.smtp.SMTPTransport.
  10. Select the Debug checkbox to enable extra debugging output, including a protocol trace, for this mail session. If the JavaMail log level is set to FINE or finer, the debugging output is generated and is included in the system log file. See "Configuring Log Levels" for information about setting the log level.

  11. In the Additional Properties area, click Add Property to add properties required by applications, such as a protocol-specific host or username property. The JavaMail API documentation lists the available properties (http://java.sun.com/products/javamail/javadocs/index.html).
  12. In the Targets area, do the following:
    1. From the Available column, select the target or targets to which applications that use the resource will be deployed. The available targets include the available clusters and server instances as well as the default server instance, server.
    2. Click Add to move the target to the Selected column.
  13. Click OK to save the session.

Equivalent asadmin command: create-javamail-resource

Editing a JavaMail Session

To edit a JavaMail session, follow these steps:

  1. In the tree component, expand the Resources node, then select the JavaMail Sessions node.
  2. On the JavaMail Sessions page, select the session to be edited.
  3. On the Edit JavaMail Session page, you can perform these tasks:
    • Modify the values in the Mail Host, Default User, Default Return Address, and Description fields.
    • Select or deselect the Enabled checkbox to enable or disable the resource.
    • Modify the values in the Advanced fields.
    • Add, remove, or modify properties.
  4. Click the Targets tab to go to the JavaMail Session Targets page. On this page, do the following:
    1. Click Manage Targets to open the Manage Resource Targets page.
    2. On this page, move targets between the Available column and the Selected column. Make sure to place in the Selected column the target or targets to which applications that use the resource will be deployed. The available targets include the available clusters and server instances as well as the default server instance, server. Click OK to save the changes.

    3. Select the checkbox for a target, then click Enable or Disable to enable or disable the resource for that target.
  5. Click Save to save the changes, or click Load Defaults to restore the default values for a mail session.

Deleting a JavaMail Session

To delete a JavaMail session, follow these steps:

  1. In the tree component, expand the Resources node, then select the JavaMail Sessions node.
  2. On the JavaMail Sessions page, select the checkbox next to the name of the session to be deleted.
  3. Click Delete.

Equivalent asadmin command: delete-javamail-resource



Previous      Contents      Next     


Copyright 2004 - 2005 Sun Microsystems, Inc. All rights reserved.