IMAP Proposal - First Draft

JAMES 1.1

Overview of proposed IMAP server on JAMES

Objective: A set of interfaces and basic implementations that provide:

System, hosts and Mailboxes

**************
* IMAPSystem *
**************
********
* Host *
********
********
* Host *
********
********************
* Folder Repository *
********************
***********
* Mailbox *
***********
***********
* Mailbox *
***********
********************
* Folder Repository *
********************
***********
* Mailbox *
***********
***********
* Mailbox *
***********
**********
* Folder *
* Record *
**********
**********
* Folder *
* Record *
**********
***********
* Message *
***********
***********
* Message *
* Attribute *
***********
***********
* Message *
***********
***********
* Message *
* Attribute *
***********
**********
* Folder *
* Record *
**********
**********
* Folder *
* Record *
**********
***********
* Message *
***********
***********
* Message *
* Attribute *
***********
***********
* Message *
***********
***********
* Message *
* Attribute *
***********

interface IMAPSystem
An IMAP system may include more than one host (ie server in the physical machine sense). For example, different hosts may handle private mailboxes, shared mailboxes and news. This interface allows a James instance to identify other servers in the IMAP system, for Login referrals and Mailbox referrals.

interface Host
An IMAP host establishes if a user has their private mail here or access to any other mail. It handles access to a mailbox.

plan: implemented by James.java

interface FolderRecord
An IMAP server needs to keep track of deleted mailboxes, so that mailboxes created with the name of a previously deleted mailbox have different UID or UIDValidity values. In some circumstances, a mailbox may be deleted but not available for its name to be reused. This interface captures this data.

plan: class SimpleFolderRecord File system implementation of FolderRecord.

interface RecordRepository
Place to keep FolderRecords

plan: class AvalonFolderRepository FileSystem implementation.

interface MailBox
As well as storing messages, an IMAP mailbox needs to keep track of folder options, such as whether inferiors/ child folders are allowed and accepatable flags and message attributes (such as flags, and envelope details).

plan: AvalonMailbox FileSystem implementation of IMAPMailBox.

interface MessageAttributes
Holds message flags and parsed data.

plan: class FileMessageAttributes FileSystem implemetation of IMAPMessageAttributes.

Servers, Connections, Commands, Events

class Server
Monitors socket and launches connection handler.

interface ConnectionHandler
Each instance handles a single connection. This includes authenticating the user, collecting commands from the client (which can require server input) and then arranging for the commands to be processed. The connection handler may arrange for multiple non-ambiguous commands to be processed concurrently, but must process ambiguous multiple commands in the order in which they are received from the client. See the Overview of IMAP commands.

Because IMAP s designed for long-lived connections (the minimum timeout is 30 minutes) it is likely that new mail will be delivered to an Inbox or mail may be added to or removed from a shared mailbox while no client commands are in process. The protocol therefore allows server data to be sent unilaterally to the client, that is not in response to a request for that data. Unilateral data may be sent while a command is being processed, indeed mailbox size changes must be sent if observed during the course of processing a command. The server may also send data while no commands are being processed (except for Expunge responses).

class MailboxEvent
MailboxEvents are sent by MailboxEventSources to any registered listener when there has been a relevant change in the Mailbox.

interface MailboxEventListener
The MailBoxEventListener interface is implemented by any object needing to monitor a mailbox. The Listener must register with the appropriate EventSource. Typically a ConnectionHandler will register with a Mailbox when it enters selected state and deregister when that mailbox is deselected.

interface MailboxEventSource
The MailboxEventSource interface is implemented by any object needing to send events to listeners. Typically a mailbox.

Copyright (c) 1997-2000 The Java Apache Project.
All rights reserved.