|
|
 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)){
....
}
}
 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;
 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.
 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?
 Silvia - 2015-08-10 07:41:40 - In reply to message 4 from 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 ; .
 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,
 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.
 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.
|