Reference
*********

Sender Protocol
===============

 -- Protocol Class: sender
     All folders which allow to store/send email have to support the sender protocol.

 -- generic function: open-message-storing-stream folder message
     Opens a stream were the client can dump an email in RFC2822 format. After closing the stream the message gets accepted by the receiver as a new message.

Receiver Protocol
=================

 -- Protocol Class: receiver
     All folders which allow to fetch email have to support the receiver protocol.

 -- function: open-message-input-stream message start
     Is a trampoline function to open-message-input-stream-using-folder. All that is done by this function is to take the folder of MESSAGE and provide it as an additional argument to open-message-input-stream-using-folder. This way it is possible to write methods which are specialized on a folder implementation.

 -- generic function: open-message-input-stream-using-folder folder message start
     Open an input stream to MESSAGE in folder FOLDER. START allows to skip the first START octets of MESSAGE.

 -- generic function: skip-headers-using-folder folder message stream
     Skip the header part of STREAM to MESSAGE contained in FOLDER. This functions purpose is to provide the hooks for efficient fetching of message bodies. A default method is provided which naively skips the headers by reading as many octets until a header terminating sequence appears (CRLF CRLF).

 -- generic function: message-header-stream-using-folder folder message
     Gives a stream to the headers of MESSAGE in FOLDER. Efficient Implementations can be provided by particular folder implementations. The default method is to just open a message input stream using open-message-input-stream. Implementations of this method are allowed to provide more data after the header is read.

 -- generic function: message-body-stream-using-folder folder message
     Gives a stream to the body of MESSAGE in FOLDER. Efficient Implementations can be provided by particular folder implementations. The default method is to open a message input stream using open-message-input-stream

 -- generic function: ensure-headers-read folder message
     Read in an cache the header-fields of MESSAGE in FOLDER.

 -- generic function: message-size-using-folder folder message
     Compute the size of a message

Message Transport Protocol
==========================

 -- generic function: clear-folder folder
     Delete all email from FOLDER.

 -- generic function: copy-folder sender receiver
     Copy all email from folder SENDER to folder RECEIVER. SENDER must support the sender protocol while RECEIVER must provide support for the receiver protocol. The default method copies all emails by using copy-message for all messages in SENDER.

 -- generic function: move-folder sender receiver
     Move all email from folder SENDER to folder RECEIVER. SENDER must support the sender protocol while RECEIVER must provide support for the receiver protocol. The default method moves all emails by using move-message for all messages in SENDER.

 -- generic function: copy-message-using-folders message sender receiver
     Copy an email from folder SENDER to folder RECEIVER. SENDER must support the sender protocol while RECEIVER must provide support for the receiver protocol. The default method copies the email by opening a storage stream to RECEIVER using open-message-storing-stream and a message input stream using open-message-input-stream. The message is then transfered byte by byte using Common Lisp I/O functions.

 -- generic function: delete-message-using-folders message folder
     Delete an email from FOLDER

 -- generic function: move-message-using-folders message sender receiver
     Move an email from SENDER to RECEIVER. The default implementation uses copy-message-using-folders and calls delete-message afterwards to delete MESSAGE from SENDER.

Folder Metainformation Protocol
===============================

 -- generic function: count-messages folder
     Returns how many messages are contained in FOLDER

 -- generic function: messages folder
     Return all messages of FOLDER.

 -- generic function: recent-messages folder
     Return all recent (new) messages of FOLDER. If there are no new messages return nil. Default Implementation returns calls messages the first time the folder is accessed and returns always nil after that.

 -- generic function: unread-messages folder
     Return all unread messages of FOLDER.

 -- generic function: uids-valid-p folder
     Default implementation .

Message Metainformation Protocol
================================

Folder Implementation Details
=============================

Maildir Folder
--------------

IMAP Folder
-----------

POP3 Folder
-----------

SMTP Relay Folder
-----------------