Package com.sun.mail.imap

An IMAP protocol provider for the JavaMail API that provides access to an IMAP message store.

See:
          Description

Interface Summary
IMAPFolder.ProtocolCommand A simple interface for user-defined IMAP protocol commands.
 

Class Summary
ACL An access control list entry for a particular authentication identifier (user or group).
IMAPFolder This class implements an IMAP folder.
IMAPStore This class provides access to an IMAP message store.
Quota This class represents a set of quotas for a given quota root.
Quota.Resource An individual resource in a quota root.
Rights The Rights class represents the set of rights for an authentication identifier (for instance, a user or a group).
Rights.Right This inner class represents an individual right.
 

Package com.sun.mail.imap Description

An IMAP protocol provider for the JavaMail API that provides access to an IMAP message store. Both the IMAP4 and IMAP4rev1 protocols are supported. Refer to RFC 2060 for more information.

A connected IMAPStore maintains a pool of IMAP protocol objects for use in communicating with the IMAP server. The IMAPStore will create the initial AUTHENTICATED connection and seed the pool with this connection. As folders are opened and new IMAP protocol objects are needed, the IMAPStore will provide them from the connection pool, or create them if none are available. When a folder is closed, its IMAP protocol object is returned to the connection pool if the pool is not over capacity.

A mechanism is provided for timing out idle connection pool IMAP protocol objects. Timed out connections are closed and removed (pruned) from the connection pool.

The connected IMAPStore object may or may not maintain a separate IMAP protocol object that provides the store a dedicated connection to the IMAP server. This is provided mainly for compatibility with previous implementations of the IMAP protocol provider.

The IMAP protocol provider supports the following properties, which may be set in the JavaMail Session object. The properties are always set as strings; the Type column describes how the string is interpreted. For example, use

	props.put("mail.imap.port", "888");
to set the mail.imap.port property, which is of type int.

Name Type Description
mail.imap.user String Default user name for IMAP.
mail.imap.host String The IMAP server to connect to.
mail.imap.port int The IMAP server port to connect to, if the connect() method doesn't explicitly specify one. Defaults to 143.
mail.imap.partialfetch boolean Controls whether the IMAP partial-fetch capability should be used. Defaults to true.
mail.imap.fetchsize int Partial fetch size in bytes. Defaults to 16K.
mail.imap.connectiontimeout int Socket connection timeout value in milliseconds. Default is infinite timeout.
mail.imap.timeout int Socket I/O timeout value in milliseconds. Default is infinite timeout.
mail.imap.statuscachetimeout int Timeout value in milliseconds for cache of STATUS command response. Default is 1000 (1 second). Zero disables cache.
mail.imap.appendbuffersize int Maximum size of a message to buffer in memory when appending to an IMAP folder. If not set, or set to -1, there is no maximum and all messages are buffered. If set to 0, no messages are buffered. If set to (e.g.) 8192, messages of 8K bytes or less are buffered, larger messages are not buffered. Buffering saves cpu time at the expense of short term memory usage. If you commonly append very large messages to IMAP mailboxes you might want to set this to a moderate value (1M or less).
mail.imap.connectionpoolsize int Maximum number of available connections in the connection pool. Default is 1.
mail.imap.connectionpooltimeout int Timeout value in milliseconds for connection pool connections. Default is 45000 (45 seconds).
mail.imap.separatestoreconnection boolean Flag to indicate whether to use a dedicated store connection for store commands. Default is false.

In general, applications should not need to use the classes in this package directly. Instead, they should use the APIs defined by javax.mail package (and subpackages). Applications should never construct instances of IMAPStore or IMAPFolder directly. Instead, they should use the Session method getStore to acquire an appropriate Store object, and from that acquire Folder objects.

WARNING: The APIs unique to this package should be considered EXPERIMENTAL. They may be changed in the future in ways that are incompatible with applications using the current APIs.