Re: Incorrect mm_type returned when parsing MIME

"DINH Viêt Hoà" <[email protected]> Thu, 24 May 2007 12:32:41 +0200
Newsgroups gmane.mail.libetpan.user
Message-ID <[email protected]>
On 5/24/07, Matt Ronge <mronge-ePFkAnfr6dRWk0Htik3J/[email protected]> wrote:
> Hey all,
>
> I've been putting together classes to parse and write MIME, and I've
> been writing unit tests for these things. While writing a unit test
> to make sure that the MIME structure is parsed out correctly, I ran
> into a problem. I have a test file, which has the structure:
>
> multipart/mixed
>      text/html
>      text/plain
>
> but LibEtPan always parses the structure as:
>
> message
>         multipart/mixed
>             text/html
>             text/plain.
>
> Just to verify that I wasn't interpreting the file wrong, I parsed it
> using the Python email utils and it confirmed that the structure
> should be:
>
> multipart/mixed
>      text/html
>      text/plain.
>
> I've created a small C program that prints out the outer most
> mm_type, and I've attached the test file I've been running on. Am I
> doing something wrong? Why does this small C program return "message"
> when it should be "multipart"?

In fact, libetpan will always put a rfc822/message MIME type as root
of the message. This is to 'normalize' MIME structure of the message.
(This will keep the same behavior for the rfc822/message contained
inside a message).
Note that a rfc822/message part has RFC822 fields
and a multipart/mixed part should not have RFC822 fields.
(By the way, I will be interested in the unit tests).

-- 
DINH Viêt Hoà

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/