email/imap4mtm/imapsession/src/cimapbodystructurebuilder.cpp
branchRCL_3
changeset 33 94cccd85bd25
parent 0 72b543305e3a
child 57 ebe688cedc25
--- a/email/imap4mtm/imapsession/src/cimapbodystructurebuilder.cpp	Tue May 25 12:38:02 2010 +0300
+++ b/email/imap4mtm/imapsession/src/cimapbodystructurebuilder.cpp	Wed Jun 09 09:37:26 2010 +0300
@@ -216,8 +216,16 @@
 				// Found a "MESSAGE/RFC822" body structure.
 				// This contains an embedded bodystructure, so parse up to the structure,
 				// and then allow the loop to parse the embedded structure.
-				ParseBodyTypeMessageRfc822L();
-				parseStep = EParseNewBodyStructure;
+				TRAPD(err, ParseBodyTypeMessageRfc822L());
+				if(err == KErrImapCorrupt)
+				    {
+				parseStep =EParseRemainderMessageRfc822;
+				    }
+				else
+				    {
+                    parseStep = EParseNewBodyStructure;
+				    }
+				
 				}
 				break;
 			case EParseRemainderMessageRfc822:
@@ -520,13 +528,14 @@
 	{
 	// body-fields SP SP body SP body-fld-lines
 	ParseBodyFieldsL();
-	
-	// envelope
-	ParseEnvelopeL();
-	
-	// Expect a body substructure next.
-	// Position iAtomWalker at the opening bracket, ready for ParseBodyStructureTypeL
-	iAtomWalker->WalkAcrossL(ETrue);
+	//Sometime RFCb22  message has empty evvelopel, in that case we are traping this and  processed.
+    TRAPD(err, ParseEnvelopeL());
+   
+    // Expect a body substructure next.
+    // Position iAtomWalker at the opening bracket, ready for ParseBodyStructureTypeL
+    iAtomWalker->WalkAcrossL(ETrue);
+    if(err == KErrImapCorrupt)
+        CImapCommand::CorruptDataL(iLogId);
 	}
 
 /**