201027_01
authorhgs
Tue, 06 Jul 2010 22:50:16 +0530
changeset 40 224522e33db9
parent 38 4e4b6adb1024
child 41 25fe1fe642e3
201027_01
email/imap4mtm/imapmailstore/src/cstoreutilities.cpp
email/imap4mtm/imapprotocolcontroller/src/cimapopfetchbody.cpp
email/imap4mtm/imapservermtm/inc/cimapupsresponsewaiter.h
email/imap4mtm/imapservermtm/src/cimapupsresponsewaiter.cpp
email/imap4mtm/imapsession/src/cimapbodystructurebuilder.cpp
email/imap4mtm/imapsettings/src/cimapsettings.cpp
email/imap4mtm/imapsyncmanager/src/cimapfolder.cpp
email/pop3andsmtpmtm/clientmtms/src/cemailaccounts.cpp
email/pop3andsmtpmtm/servermtmutils/src/imcvrecv.cpp
email/pop3andsmtpmtm/smtpservermtm/src/IMSM.CPP
mmsengine/mmssettings/src/cmmsaccounts.cpp
--- a/email/imap4mtm/imapmailstore/src/cstoreutilities.cpp	Tue Jun 29 23:42:47 2010 +0530
+++ b/email/imap4mtm/imapmailstore/src/cstoreutilities.cpp	Tue Jul 06 22:50:16 2010 +0530
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -48,7 +48,6 @@
 	
 void CStoreUtilities::ConstructL()
 	{
-	User::LeaveIfError(iFs.Connect());
 	// Create converter objects
 	iCharacterConverter=CCnvCharacterSetConverter::NewL();
 	iCharConv=CImConvertCharconv::NewL(*iCharacterConverter, iFs);	
--- a/email/imap4mtm/imapprotocolcontroller/src/cimapopfetchbody.cpp	Tue Jun 29 23:42:47 2010 +0530
+++ b/email/imap4mtm/imapprotocolcontroller/src/cimapopfetchbody.cpp	Tue Jul 06 22:50:16 2010 +0530
@@ -1574,6 +1574,11 @@
 	CImHeader *messageheader=CImHeader::NewLC();
 	ProcessEnvelopeL(messageheader, aMessage, aBodyStructure->GetRfc822EnvelopeStructureL());
 
+	if(aBodyStructure->EmbeddedBodyStructureList().Count() == 0)
+	    {
+        aMessage.iType=KUidMsvAttachmentEntry;
+	    }
+	
 	// Create message
 	User::LeaveIfError(iServerEntry.CreateEntryBulk(aMessage)); // bulk op completed at the end of ProcessBodyStructureL()
 	SetEntryL(aMessage.Id());
@@ -1592,9 +1597,17 @@
 	TInt attachments=0;
 	TInt relatedAttachments;
 	TBool isMHTML=EFalse;
+	CImapBodyStructure* bodystructure = NULL;
 	
-	CImapBodyStructure* bodystructure = aBodyStructure->EmbeddedBodyStructureList()[0];
-	BuildTreeL(aMessage.Id(), bodystructure, aPath, aMessage.Id(), attachments, isMHTML, relatedAttachments);
+	if(aBodyStructure->EmbeddedBodyStructureList().Count() > 0)
+	    {
+	    bodystructure = aBodyStructure->EmbeddedBodyStructureList()[0];
+        }	
+	if (bodystructure)
+	    {
+        BuildTreeL(aMessage.Id(), bodystructure, aPath, aMessage.Id(), attachments, isMHTML, relatedAttachments);
+	    }
+	
 	__LOG_FORMAT((iSession->LogId(), "  Built embedded message id %x attachments %d MHTML %d", aMessage.Id(), attachments, isMHTML));
 
 	// Save attachment and MHTML flags
@@ -1879,10 +1892,15 @@
 	iHeaderConverter->DecodeAllHeaderFieldsL(*aHeader);
 
 	// Set from line in TMsvEntry
-	aEntry.iDetails.Set(aHeader->From());
-
+	if(aHeader->From().Length() > 0)
+	    {
+        aEntry.iDetails.Set(aHeader->From());
+	    }
+	if(aHeader->Subject().Length() > 0)
+	    {
 	// Set subject in TMsvEntry
-	aEntry.iDescription.Set(aHeader->Subject());
+	    aEntry.iDescription.Set(aHeader->Subject());
+	    }
 
 	__LOG_TEXT(iSession->LogId(), "   Finished processing envelope information");
 	}
--- a/email/imap4mtm/imapservermtm/inc/cimapupsresponsewaiter.h	Tue Jun 29 23:42:47 2010 +0530
+++ b/email/imap4mtm/imapservermtm/inc/cimapupsresponsewaiter.h	Tue Jul 06 22:50:16 2010 +0530
@@ -1,6 +1,6 @@
 // cimapupsresponsewaiter.h
 
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -50,6 +50,7 @@
 	void DoRunL();
 	void DoCancel();
 private:
+	CImapSettings*              iImapSettings;
 	CMsvServerEntry& 			iServerEntry;
 	CImapProtocolController& 	iImapProtocolController;
 	CMsvEntrySelection* 		iEntrySelection;
--- a/email/imap4mtm/imapservermtm/src/cimapupsresponsewaiter.cpp	Tue Jun 29 23:42:47 2010 +0530
+++ b/email/imap4mtm/imapservermtm/src/cimapupsresponsewaiter.cpp	Tue Jul 06 22:50:16 2010 +0530
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -37,7 +37,8 @@
 CImapUpsResponseWaiter::CImapUpsResponseWaiter(CMsvServerEntry& aServerEntry, CImapProtocolController& aImapProtocolController)
 	:CMsgActive(EPriorityStandard), iServerEntry(aServerEntry), iImapProtocolController(aImapProtocolController)
 	{
-	CActiveScheduler::Add(this);
+    iImapSettings = CImapSettings::NewL(iServerEntry);
+    CActiveScheduler::Add(this);
 	}
 
 /**
@@ -46,6 +47,7 @@
 CImapUpsResponseWaiter::~CImapUpsResponseWaiter()
 	{
 	Cancel();
+	delete iImapSettings;
 	iUpsSubsession.Close();
 	iUpsSession.Close(); 
 	}
@@ -73,28 +75,32 @@
 		{
 		iState = EIMAP4MTMConnectAndSynchronise;
 		}
-	iEntrySelection = &aEntrySelection;
+	
+    iEntrySelection = &aEntrySelection;
 	
 	iDecision = EUpsDecNo;
 	
-	CImapSettings* imapSettings = CImapSettings::NewL(iServerEntry);
-	CleanupStack::PushL(imapSettings);
-	imapSettings->LoadSettingsL(iServerEntry.Entry().Id());
+	if( iImapSettings->SettingsLoaded() == EFalse)
+	    {
+	    iImapSettings->LoadSettingsL(iServerEntry.Entry().Id());
+	    }
 
 	// Connect to UPS service.....
 	User::LeaveIfError(iUpsSession.Connect());
+
 	RThread clientThread;
  	User::LeaveIfError(clientThread.Open(aClientThreadId));
 	CleanupClosePushL(clientThread);
- 	User::LeaveIfError(iUpsSubsession.Initialise(iUpsSession, clientThread));
+
+    User::LeaveIfError(iUpsSubsession.Initialise(iUpsSession, clientThread));
 	CleanupStack::PopAndDestroy(&clientThread);
 	
-	
 	iStatus=KRequestPending;
-	iUpsSubsession.Authorise(aHasCapability, KUidIMAPService, imapSettings->ServerAddress(), iDecision, iStatus);
+	iUpsSubsession.Authorise(aHasCapability, KUidIMAPService, iImapSettings->ServerAddress(), iDecision, iStatus);
+
 	Queue(aStatus);
 	SetActive();
-	CleanupStack::PopAndDestroy();// imapSettings
+    	
 	}
 
 
--- a/email/imap4mtm/imapsession/src/cimapbodystructurebuilder.cpp	Tue Jun 29 23:42:47 2010 +0530
+++ b/email/imap4mtm/imapsession/src/cimapbodystructurebuilder.cpp	Tue Jul 06 22:50:16 2010 +0530
@@ -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,13 @@
 	{
 	// 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);
+    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);
 	}
 
 /**
--- a/email/imap4mtm/imapsettings/src/cimapsettings.cpp	Tue Jun 29 23:42:47 2010 +0530
+++ b/email/imap4mtm/imapsettings/src/cimapsettings.cpp	Tue Jul 06 22:50:16 2010 +0530
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -170,7 +170,7 @@
 void CImapSettings::ReadResourceFileL()
 	{
 	RFs fs;
-	fs.Connect();
+	User::LeaveIfError(fs.Connect());
 	CleanupClosePushL(fs);
 	
 	//	NB need to check on all drives - won't necessarily be on
--- a/email/imap4mtm/imapsyncmanager/src/cimapfolder.cpp	Tue Jun 29 23:42:47 2010 +0530
+++ b/email/imap4mtm/imapsyncmanager/src/cimapfolder.cpp	Tue Jul 06 22:50:16 2010 +0530
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -96,6 +96,12 @@
 	iMatchingMessageIds.Reset();
 	iDeletedMessageIds.Reset();
 	iMissingMessageIds.Reset();
+	
+	if(iCachedEntryData)
+		{
+	    iCachedEntryData->Close();
+		}
+		
 	delete iSelection;
 	iFolderIndex->Reset();
 	iMessageFlagInfoArray.Reset();
@@ -1121,9 +1127,12 @@
 	SetEntryL(aFolder);
 	GetChildrenL(*aChildren);
 
+	if(iCachedEntryData)
+	    {
+        iCachedEntryData->Close();
+	    }
 	delete iCachedEntryData;
 	iCachedEntryData = NULL;
-
 	iCachedEntryData = new(ELeave) RArray<TMsvCacheData>(5);
 
 	// Go through them, checking to see if they're messages and removing ones that aren't
--- a/email/pop3andsmtpmtm/clientmtms/src/cemailaccounts.cpp	Tue Jun 29 23:42:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/src/cemailaccounts.cpp	Tue Jul 06 22:50:16 2010 +0530
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -809,6 +809,7 @@
 */ 
 EXPORT_C void CEmailAccounts::GetPopAccountsL(RArray<TPopAccount>& aAccounts)
 	{
+    CleanupClosePushL( aAccounts );
 	aAccounts.Reset();
 	CRepository& popRepository = PopRepositoryL();
 	
@@ -855,7 +856,8 @@
 			}		
 		}
 		
-	CleanupStack::PopAndDestroy(3, &popAccountIds);				
+	CleanupStack::PopAndDestroy(3, &popAccountIds);
+	CleanupStack::Pop(&aAccounts); // aAccounts
 	}
 
 /**
@@ -921,6 +923,7 @@
 */    			
 EXPORT_C void CEmailAccounts::GetImapAccountsL(RArray<TImapAccount>& aAccounts)
 	{
+    CleanupClosePushL( aAccounts );
 	aAccounts.Reset();
 	CRepository& imapRepository = ImapRepositoryL();
 
@@ -967,7 +970,8 @@
 			}		
 		}
 
-	CleanupStack::PopAndDestroy(3, &imapAccountIds);			
+	CleanupStack::PopAndDestroy(3, &imapAccountIds);	
+	CleanupStack::Pop(&aAccounts);  // aAccounts
 	}
 
 void CEmailAccounts::GetEmailServicesL(CMsvEntrySelection& aServices, TUid aMTMType, CMsvEntry& aMsvEntry)
@@ -1057,6 +1061,7 @@
 */    			
 EXPORT_C void CEmailAccounts::GetSmtpAccountsL(RArray<TSmtpAccount>& aAccounts)
 	{
+    CleanupClosePushL( aAccounts );
 	aAccounts.Reset();
 	CRepository& smtpRepository = SmtpRepositoryL();
 	
@@ -1103,7 +1108,8 @@
 			}		
 		}
 
-	CleanupStack::PopAndDestroy(3, &smtpAccountIds);				
+	CleanupStack::PopAndDestroy(3, &smtpAccountIds);		
+	CleanupStack::Pop(&aAccounts);  // aAccounts
 	}
 
 /**
@@ -1116,6 +1122,7 @@
 */
 EXPORT_C void CEmailAccounts::GetSmtpMobilityAccountsL(const TSmtpAccount& aSmtpAccount, RArray<TSmtpMobilityAccount>& aAccounts)
 	{
+    CleanupClosePushL( aAccounts );
 	aAccounts.Reset();
 
 	CRepository& repository = SmtpRepositoryL();
@@ -1150,6 +1157,8 @@
 		{
 		User::Leave(err);
 		}
+	
+	CleanupStack::Pop(&aAccounts);  // aAccounts
 	}
 
 /**
@@ -1161,6 +1170,7 @@
 */
 EXPORT_C void CEmailAccounts::GetSmtpMobilityAccountsL(RArray<TSmtpMobilityAccount>& aAccounts)
 	{
+    CleanupClosePushL( aAccounts );
 	aAccounts.Reset();
 
 	CRepository& repository = SmtpRepositoryL();
@@ -1190,6 +1200,7 @@
 		}
 
 	CleanupStack::PopAndDestroy(&smtpAccountIds);
+	CleanupStack::Pop(&aAccounts);  // aAccounts
 	}
 
 /**
--- a/email/pop3andsmtpmtm/servermtmutils/src/imcvrecv.cpp	Tue Jun 29 23:42:47 2010 +0530
+++ b/email/pop3andsmtpmtm/servermtmutils/src/imcvrecv.cpp	Tue Jul 06 22:50:16 2010 +0530
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -415,11 +415,9 @@
 	iStore8BitData = reader.ReadInt8();
 	CleanupStack::PopAndDestroy(buf);
 	
-	//read iStorePlainBodyText flag for writing bodytext chunk bu chunk.
-	buf = resFile.AllocReadLC( STORE_PLAIN_BODY_TEXT );
-	reader.SetBuffer(buf);
-	iStorePlainBodyText = reader.ReadInt8();
-	CleanupStack::PopAndDestroy(buf);
+	//read iStorePlainBodyText flag for writing bodytext chunk by chunk.
+	//For Pop case, it always writes bodytext chunk by chunk
+	iStorePlainBodyText = 1;
 
 
 	buf = resFile.AllocReadLC( REMOVED_ATTACHMENT_TAG );
@@ -3976,7 +3974,11 @@
 			iLex.UnGetToMark(initMark);
 			ParseRfc2231ParameterInfoL(aTag, rBuffer, offset );
 			}
-			CleanupStack::Pop(rBuffer8);
+		if( param.Length() > 0 )
+		    {
+            CleanupStack::Pop(rBuffer8);
+		    }
+			
 		}
 	}
 
--- a/email/pop3andsmtpmtm/smtpservermtm/src/IMSM.CPP	Tue Jun 29 23:42:47 2010 +0530
+++ b/email/pop3andsmtpmtm/smtpservermtm/src/IMSM.CPP	Tue Jul 06 22:50:16 2010 +0530
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -791,24 +791,10 @@
 */
 void CMsgImOutboxSend::Complete(TInt status)
 	{
-	if (iState != EStateMobilityError)
-		{
-		// Respond to any outstanding bearer mobility requests as we are about
-		// to exit and we don't need to hold up the migration.
-		if (PreparingForMigration())
-			{
-			SignalMigrate();
-			}
-		else if (iMobilityOperation == EMobilityOperationMigrating &&
-		         iState == EStateConnectingSession)
-			{
-			if (iMobilityManager)
-				{
-				iMobilityManager->NewCarrierAccepted();
-				}
-			}
-		}
-
+    // sending of all the emails has completed, no need listen for Mobility Manager
+	delete iMobilityManager;
+	iMobilityManager=NULL;
+	
 	delete iSession;
 	iSession = NULL;
 	delete iSessionManager;
@@ -1224,8 +1210,8 @@
 	delete iWaiter;	
 #endif
 
+	delete iMobilityManager;
 	delete iSessionManager;
-	delete iMobilityManager;
 	}
 
 CDesCArray& CMsgImOutboxSend::BccRcptArray()
--- a/mmsengine/mmssettings/src/cmmsaccounts.cpp	Tue Jun 29 23:42:47 2010 +0530
+++ b/mmsengine/mmssettings/src/cmmsaccounts.cpp	Tue Jul 06 22:50:16 2010 +0530
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -249,6 +249,7 @@
 */                   
 EXPORT_C void CMmsAccounts::GetMMSAccountsL(RArray<TMmsAccountId>& aAccountIds) const
 	{
+    CleanupClosePushL( aAccountIds );
 	aAccountIds.Reset();
 	RArray<TUint32> accountIds;	
 	CleanupClosePushL(accountIds);	
@@ -268,7 +269,8 @@
 		aAccountIds.AppendL(accountId);		
 		}
 		
-	CleanupStack::PopAndDestroy(&accountIds);				
+	CleanupStack::PopAndDestroy(&accountIds);
+	CleanupStack::Pop(&aAccountIds);  // aAccountIds
 	}
 
 /**