
This function is intended to parse MIME (RFC2045) messages (coming from a RFC822 or HTTP sources).
It parses the text and produces an array structure representing the structure of the MIME message.
It copies into the structure MIME headers, but for the MIME bodies it only stores start and end offsets,
thus optimizing space usage.

The parameters to mime_tree are:

If flag is 1, the "root" message follows RFC822. This means mime_tree will unfold the attributes,
will scan for MIME registered header fields and will take their attributes. or it@s a MIME message
(needs no unfolding and has attributes separated with semicolon).

If flag is 2, the "root" message follows RFC2045. This means mime_tree will scan for MIME attributes.

In either cases mime_tree will look for the Content-Type header field and will parse
the "message/rfc822" and "multipart/digest" MIME bodies as nested messages.

mime_tree will return an array of 3 elements (message descriptor) with the following structure:
