Re: mailmime_parse() can not work if there are some redundant words in the first line of mime file

"DINH Viêt Hoà" <[email protected]> Wed, 19 Mar 2008 11:56:27 +0100
Newsgroups gmane.mail.libetpan.user
Message-ID <[email protected]>
On Wed, Mar 19, 2008 at 11:30 AM,  <[email protected]> wrote:
> Hi libetpan guys
>  I get the latest CVS  libetpan,
>  and I use readmsg-simple to fetch original MIME of a message from a IMAP
> mail server
>  But there are some redundant words in the first line of this original MIME
>  It result in mailmime_parse() can not parse succeed
>  attachment is this MIME file
>  Is it any good solution to fix this bug?
>  Thank you :)

What do you call "some redundant words" in the given message ?

I think that if you remove the following first line:

<<
>From [email protected] Wed, 19 Mar 2008 05:09:58 -0400
>>

the parse will work.

the line starting with "From_" ("from" followed by a space) is not
part of RFC 2822 nor MIME specification.
This is part of mbox specification.

Since the MIME parser is working only with RFC 2822 and MIME
specification, it will not work on that kind of message.
The solution is just to remove this line before giving it to the MIME parser.

Did you get that message source from the IMAP server ? That would mean
that your IMAP server does not follow the specification.
Or you pushed some messages that do not follow the specification.

-- 
DINH Viêt Hoà

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/