PHP Classes

incomplete message body part, if there are quotes on the subject

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  incomplete message body part, if...  >  (Un) Subscribe thread alerts  
Subject:incomplete message body part, if...
Summary:incomplete message body part, if there are quotes on the subject
Messages:9
Author:Silvia
Date:2015-07-01 12:15:52
 

  1. incomplete message body part, if...   Reply   Report abuse  
Picture of Silvia Silvia - 2015-07-01 12:15:53
First of all, thank you for the class.

I am using your mime_parser.php and pop3 class.
When an email has quotation marks in the subject , I get the following error: incomplete message body part

I'd appreciate any help.
thanks.


if(($error=$pop3->Open())==""){
if(($error=$pop3->Login($user,$pass,$apop))==""){
if(($error=$pop3->Statistics($messages,$size))==""){
for($message=1;$message<=$messages;$message++){
if($messages>0){
$pop3->GetConnectionName($connection_name);
$message_file='pop3://'.$connection_name.'/'.$message;

$mime=new mime_parser_class;
$mime->decode_bodies = 1;

$parameters=array(
'File'=>$message_file,
'SkipBody'=>0,
);
$success=$mime->Decode($parameters, $decoded);
$enc="";

if(!$success){//si falla
die("Error al decodificar un mensaje ".strip_tags($mime->error));
//*** when quotes comes here and gives the error message
}else{
if($mime->Analyze($decoded[0], $results)){
....
}
}

  2. Re: incomplete message body part, if...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-07-01 19:07:47 - In reply to message 1 from Silvia
That may be because PHP now comes with its own pop3 stream handler, so you need to use a different name, like mlpop3 .

Change your script to have this line:

stream_wrapper_register('mlpop3', 'pop3_stream');

and then use:

$message_file='mlpop3://'.$connection_name.'/'.$message;

  3. Re: incomplete message body part, if...   Reply   Report abuse  
Picture of Silvia Silvia - 2015-07-06 08:07:42 - In reply to message 2 from Manuel Lemos
Thanks , but I have tried and still gives the same error.

Only happens when the subject have quotes. Other emails are processed well . But when one email have quotes , blocks all until I delete this email.

  4. Re: incomplete message body part, if...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-07-06 17:57:35 - In reply to message 3 from Silvia
Can you please save the message complete with headers and upload it somewhere so I can take a look and see if it is a problem in the parser?

  5. Re: incomplete message body part, if...   Reply   Report abuse  
Picture of Silvia Silvia - 2015-08-10 07:41:40 - In reply to message 4 from Manuel Lemos
Hello,

Here I leave one of the emails that I get error.
thank you.

drive.google.com/file/d/0B4JA5qMM2y ...

I'm sorry for the delay.
Best regards,

  6. Re: incomplete message body part, if...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-08-12 01:28:32 - In reply to message 5 from Silvia
The problem is that the Content-Type header seems to be malformed. The boundary part is missing a semi-colon before the report-type that is in the continuation line of the header.

Did you generate this message or was it sent by some other software that you do not control?

If you generated this message, you need to fix the content-type header adding the missing ; .

  7. Re: incomplete message body part, if...   Reply   Report abuse  
Picture of Silvia Silvia - 2015-08-17 06:55:24 - In reply to message 6 from Manuel Lemos
Hi,

I don't generate this message.
Then the problem is in the message that arrives.
thank you!

To see if I can control it, and that I haven't control over the email.

Best regards,

  8. Re: incomplete message body part, if...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-08-18 03:36:48 - In reply to message 7 from Silvia
Well I think the program that sends the message assumes it does not need to put a semi-colon in the parameters because there is a line break.

If you are getting many messages like this, what I can do is to add some code to tolerate these errors, so you can get the parsed message as if it was valid and the errors just become non-fatal warnings.

Just let me know if this would be useful.

  9. Re: incomplete message body part, if...   Reply   Report abuse  
Picture of Silvia Silvia - 2015-08-19 11:59:12 - In reply to message 8 from Manuel Lemos
Hi,

Yes, it would be very useful because I am gettting many emails like this.

Thank you so much for everything.