Message Parts

Each part of the message is represented in the stream as follows:

<MIME-Message-Part>
<Header>
...
</Header>
<Message-Part-Data>
Size: 1234
(the data - can be binary or text)
OptionalTerminatingString  
</Message-Part-Data>   
</MIME-Message-Part>

The header is identical to the header used in the top-level message, but generally only uses the Content-* fields.

The data of the part is enclosed in the <Message-Part-Data> tags. This might begin with a size if the data is binary. The value of the size is given by a character integer value. The size is followed by a CR/LF. The data then follows. It can be terminated by a terminator that is specified in the header of the message part by the Boundary field. If this is not specified, then the terminator is </Message-Part-Data>, which is always present regardless of whether there is an additional terminator or not.

It is possible to nest message parts, which is required in contexts such as RosettaNet messages.