PHP Classes

Error parsing message with attachment

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  Error parsing message with attachment  >  (Un) Subscribe thread alerts  
Subject:Error parsing message with attachment
Summary:Error says "incomplete message body part"
Messages:6
Author:Alexander Zakusilo
Date:2010-02-01 15:24:32
Update:2010-02-02 12:13:41
 

  1. Error parsing message with attachment   Reply   Report abuse  
Picture of Alexander Zakusilo Alexander Zakusilo - 2010-02-01 15:24:32
Here's the example message which cannot be parsed with the parser class:

box.net/shared/jn4xjqhzug

It contains a pdf attachment.

Mozilla Thunderbird opens this file just fine, but the parser class says "incomplete message body part"

I'd appreciate any help.

Thanks.

  2. Re: Error parsing message with attachment   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2010-02-01 16:24:49 - In reply to message 1 from Alexander Zakusilo
Here it parses the message perfectly.

Are you using the latest version of the class?

What PHP version are you using?

  3. Re: Error parsing message with attachment   Reply   Report abuse  
Picture of Alexander Zakusilo Alexander Zakusilo - 2010-02-02 07:34:45 - In reply to message 2 from Manuel Lemos
PHP is 5.3.0

The full error message:

MIME message decoding error: incomplete message body part at position 904465 line 12249 column 1

I use 2009-11-08 version (mime_parser.php v.1.66)

Test code is just test_message_decoder.php from the package (with modified path to .eml file)

  4. Re: Error parsing message with attachment   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2010-02-02 09:13:53 - In reply to message 3 from Alexander Zakusilo
I also tried with PHP 5.3.0 and it works equally well.

Anyway, the file that you provided has only 904457 bytes and 12248 lines, which suggests that you provided a slightly different file from the one you are trying.

Make sure you provide a file that is exactly the same.

  5. Re: Error parsing message with attachment   Reply   Report abuse  
Picture of Alexander Zakusilo Alexander Zakusilo - 2010-02-02 11:41:23 - In reply to message 4 from Manuel Lemos
I re-checked it, the file size is 904457, that's right, and yes, the reported error position is 904465, which is greater than 904457.

Here's the complete set of files of my last test (note: fix the absolute path in test script before trying it)
box.net/shared/qb3byphc6u

Result:
MIME message decoding error: incomplete message body part at position 904465 line 12249 column 1

Is is possible to have incorrect CR/LF conversions during file reading ?

  6. Re: Error parsing message with attachment   Reply   Report abuse  
Picture of Alexander Zakusilo Alexander Zakusilo - 2010-02-02 12:13:41 - In reply to message 5 from Alexander Zakusilo
The problem is resolved.

By some reason PHP has the magic quotes turned on by default (although PHP declares that magic quotes are obsolete as of PHP 5.3.0).

Magic quotes must be OFF in order for MIME E-mail message parser to work correctly

Thanks