3.6. Message Structure
An internet message is composed of three parts. The first is the tid which identifies the transaction; the second is the Command List; and the third part is the Document List, which is itself comprised of a Document-Header and a Document-Body.
When shipped between two MPMs, a message will take the form of a LIST:
Message is:
LIST ( tid, Command-List, Document-List )
It is convenient to batch several messages together shipping them as a unit from one MPM to another. Such a group of messages is called a message-bag.
A message-bag will be a LIST of Messages, each Message is of the form described above.
Thus, a message-bag is:
LIST ( Message1, Message2, ... )
Message Sharing
When messages are batched for delivery, it may often be the case that the same Document will be sent to more than one recipient. Since the Document portion can usually be expected to be the major parts of the message, much repeated data would be sent if a copy of the Mail for each recipient were to be shipped in the message-bag.
To avoid this redundancy, messages are assembled in the message-bag so that actual data appears first and references to it appear later in the message-bag. Since each message has a unique tid, the references will indicate the tid of the actual data. In this sense, all references to copied data may be thought of as pointing earlier in the message-bag. The data to be retrieved can be thought of as indexed by tid. Note that the semantics require such references to point to data already seen.
When a portion is Shared, that portion is determined by its position within a message, i.e., if the Command list was to be Shared, then its position within a Message would contain the tid of the message already seen whose Command list was identical to it. The same is true of the Document Header and the Document Body. Only a complete Command, Header, or Body may be Shared, never a partial one.
If an encryption scheme is used, that portion of the message which is encrypted can not be shared. This is due to the fact that encrypting keys will be specific between two individuals.
Internal Message Organization
The tid
This is the transaction identifier. It is assigned by the originating MPM.
The Command List
The command-list is a LIST which contains two elements, content and command.
Content is one item of element type INDEX. If content=0, the item is not shared and the next element of the LIST is the command. If content=1 the item is shared. In this case, the second element will contain the tid of the command to share from. The tid must be of a prior message in the current message-bag. Other values of content may be defined later for different data structures.
Thus, command-list is:
LIST ( content, tid ) if content=1
Or,
LIST ( content, command ) if content=0
content is:
INDEX which is 0 if there is no sharing
and is 1 if sharing occurs
tid is:
the tid of the message to be shared from
command is:
LIST ( mailbox, stamp, type, operation, arguments, error-list )
The document-list
The document portion of an internet message is optional and when present is comprised of a LIST containing two elements:
document-list is:
LIST ( header-list, body-list )
While either the header-list or the body-list may be shared, both elements must appear in the m.
The document-header
The header-list will be a List which will always contain two elements. The first element will be content to indicate whether or not the header is to be shared. The second element will either be the tid of the header to be copied (if content=1) or it will be the document-header (which is a PROPLIST) containing the actual header information (if content=0). The tid must point to a document-header already seen in the message-bag.
The header-list is either:
LIST ( content, tid ) if content=1
Or,
LIST ( content, document-header ) if content=0
document-header is:
PROPLIST which contains header information
The document-body
The body-list will be a LIST of two elements. The first element will again be content, indicating whether or not the body is to be shared. If it is shared, the second element will be tid indicating which body to copy. This tid must be of a message already seen in the message-bag. If content indicates no sharing, then the second item is a document-body.
body-list is:
LIST ( content, tid ) if content=1
Or,
LIST ( content, document-body ) if content=0
document-body is:
LIST ( items comprising the body ... )
Message Fields
message := ( tid, command-list, document-list )
tid := ( tn, ihn )
command-list := ( content, command )
command := ( mailbox, stamp, type, operation,
arguments, error-list )
document-list := ( header-list, body-list )
header-list := ( content, document-header )
body-list := ( content, document-body )