//
// Copyright (c) 2009 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"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//
//! @file

RUN_UTILS DeleteFile c:\messaging.db

LOAD_SUITE	T_MsgCommonServer	-SharedData
LOAD_SUITE	T_MsgImapServer		-SharedData
LOAD_SUITE	T_MsgSmtpServer		-SharedData

//!	@SYMTestCaseID				MSG-IMAP-DownloadRules-0001
//!	@SYMTestCaseDesc			Positive: Create an IMAP email account that defines a per bearer type list of email download rules (+ve)
//!	@SYMTestPriority			Critical
//!	@SYMTestType				CIT
//! @SYMREQ						6982, 6987
//! @SYMPREQ					1307
//!	@SYMTestStatus				Implemented
//!	@SYMTestActions				1.	Reset Message Store and Central Repository to default state.
//!								2.	Create IMAP account with a per bearer type list of email download rules in Central Repository using settings from a configuration file.
//!									(Keep the download rules for both Inbox and the other folders the same)
//!								3.	Check for success of step 2.
//!								4.	Modify the per bearer type list of email download rules in step 2.
//!									(Specify a different set of download rules for Inbox and the other folders)
//!								5.	Check for success of step 4.
//!								6.	Delete the per bearer type download rules list that was modified in step 4 from the email account for both Inbox and other folders.
//!								7.	Check for success of step 6.
//!
//!	@SYMTestExpectedResults		Steps 2, 4 and 6 to pass.
//!	@SYMAuthor					Sandip Ahluwalia

START_TESTCASE	MSG-IMAP-DownloadRules-0001

RUN_TEST_STEP	300	T_MsgCommonServer	StartUp
RUN_TEST_STEP	300	T_MsgImapServer		StartUp

PRINT Setup Begins #####################################################
RUN_TEST_STEP	300	T_MsgCommonServer	InitNtRas						c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0001-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0001-ResetMessageStore
PRINT Setup Completed ##################################################

RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccountWithDLRules	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0001-CreateImapAccountWithDLRules
RUN_TEST_STEP	300	T_MsgImapServer		CheckImapSyncDLRules			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0001-CheckImapSyncDLRulesINBOX
RUN_TEST_STEP	300	T_MsgImapServer		CheckImapSyncDLRules			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0001-CheckImapSyncDLRulesOTHER
RUN_TEST_STEP	300	T_MsgImapServer		ModifyImapSyncDLRules			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0001-ModifyPerBearerListOfDLRulesINBOX
RUN_TEST_STEP	300	T_MsgImapServer		CheckImapSyncDLRules			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0001-CheckModifiedImapSyncDLRulesINBOX
RUN_TEST_STEP	300	T_MsgImapServer		ModifyImapSyncDLRules			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0001-ModifyPerBearerListOfDLRulesOTHER
RUN_TEST_STEP	300	T_MsgImapServer		CheckImapSyncDLRules			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0001-CheckModifiedImapSyncDLRulesOTHER
RUN_TEST_STEP	300	T_MsgImapServer		DeleteImapSyncDLRules			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0001-DeleteImapSyncDLRulesINBOX
RUN_TEST_STEP !Error=-1	300	T_MsgImapServer	CheckImapSyncDLRules	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0001-CheckDeletedImapSyncDLRulesINBOX
RUN_TEST_STEP	300	T_MsgImapServer		DeleteImapSyncDLRules			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0001-DeleteImapSyncDLRulesOTHER
RUN_TEST_STEP !Error=-1	300	T_MsgImapServer	CheckImapSyncDLRules	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0001-CheckDeletedImapSyncDLRulesOTHER

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer		ShutDown

END_TESTCASE	MSG-IMAP-DownloadRules-0001

//!	@SYMTestCaseID				MSG-IMAP-DownloadRules-0002
//!	@SYMTestCaseDesc			Positive: Create an IMAP email account to use it's per bearer type list of email download rules. (+ve)
//!	@SYMTestPriority			Critical
//!	@SYMTestType				CIT
//! @SYMREQ						6982, 6987
//! @SYMPREQ					1307
//!	@SYMTestStatus				Implemented
//!	@SYMTestActions				1.	Reset Message Store and Central Repository to default state.
//!								2.	Create IMAP account in Central Repository using settings from a configuration file that specifies it will use its defined per bearer type list of email download rules.
//!								3.	Check for success of step 2.
//!								4.	Modify the settings in step 2 to not use per bearer type list of email download rules.
//!								5.	Check for success of step 4.
//!								6.	Modify the settings set in step 4 again to use the per bearer type list of email download rules.
//!								7.	Check for success of step 6.
//!
//!	@SYMTestExpectedResults		Steps 2, 4 and 6 to pass.
//!	@SYMAuthor					Sandip Ahluwalia

START_TESTCASE	MSG-IMAP-DownloadRules-0002

RUN_TEST_STEP	300	T_MsgCommonServer	StartUp
RUN_TEST_STEP	300	T_MsgImapServer		StartUp

PRINT Setup Begins #####################################################
RUN_TEST_STEP	300	T_MsgCommonServer	InitNtRas						c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0002-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0002-ResetMessageStore
PRINT Setup Completed ##################################################

RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccountWithoutSmtp	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0002-CreateImapAccountWithoutSmtp
RUN_TEST_STEP	300	T_MsgImapServer		CheckImapDLRulesSetting			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0002-CheckImapDLRulesSetting0
RUN_TEST_STEP	300	T_MsgImapServer		ModifyImapSettings				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0002-TurnDownloadRulesOFF
RUN_TEST_STEP	300	T_MsgImapServer		CheckImapDLRulesSetting			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0002-CheckImapDLRulesSetting1
RUN_TEST_STEP	300	T_MsgImapServer		ModifyImapSettings				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0002-TurnDownloadRulesON
RUN_TEST_STEP	300	T_MsgImapServer		CheckImapDLRulesSetting			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0002-CheckImapDLRulesSetting0

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer		ShutDown

END_TESTCASE	MSG-IMAP-DownloadRules-0002

//!	@SYMTestCaseID				MSG-IMAP-DownloadRulesFetch-0001
//!	@SYMTestCaseDesc			Positive: Automatically fetch message content using download rules when synchronising using KIMAP4MTMConnectAndSynchronise. (+ve)
//!	@SYMTestPriority			Critical
//!	@SYMTestType				CIT
//! @SYMREQ						6987, 6982
//! @SYMPREQ					1307
//!	@SYMTestStatus				Implemented
//!	@SYMTestCaseDependencies	Requires CED tool to be run over c:\ced_default_ras.cfg to set CommDB as required when using NTRAS for connection to Email servers.
//!	@SYMTestActions				1.	Reset Message Store and Central Repository to default state.
//!								2.	Create IMAP account in Central Repository using standard settings from a configuration file.
//!								3.	Connect and sync to IMAP service using account settings and initialise account on remote IMAP server to default clean state.
//!								4.	Disconnect from IMAP service.
//!								5.	Create multiple messages from file and send using SMTP service to remote INBOX.
//!								6.	Create remote root-level personal folder with multiple messages (New folder is remotely subscribed and messages copied within service from remote INBOX using a separate IMAP a/c).
//!								7.	Set IMAP service settings to not use IMAP IDLE command.
//!								8.	Modify the email account settings to specify it will use it's defined per bearer type list of email download rules.
//!								9.	Define a per bearer type list of email download rules for both remote Inbox and the personal folder created in step 6.
//!								10.	Connect and sync (KIMAP4MTMConnectAndSynchronise) to IMAP service using account settings and wait for both background and 2nd phase synchronisation using download rules to complete.
//!								11.	Check that messages are fetched in remote Inbox and the personal folder created in step 6 as required according to the download rules defined in step 9.
//!								12.	Disconnect from IMAP service.
//!
//!	@SYMTestExpectedResults		See step 11.
//!	@SYMAuthor					Sandip Ahluwalia

START_TESTCASE	MSG-IMAP-DownloadRulesFetch-0001

RUN_TEST_STEP	300	T_MsgCommonServer	StartUp
RUN_TEST_STEP	300	T_MsgImapServer		StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer		StartUp

PRINT Setup Begins #####################################################
RUN_TEST_STEP	300	T_MsgCommonServer	InitNtRas						c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-ResetMessageStore
PRINT Setup Completed ##################################################
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccount				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CreateImapAccount
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-ChangeImap4SubAndSyncSettings
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		InitialiseImap4Account			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-InitialiseImap4Account
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-DoFullImap4Synchronisation
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-DisConnectImapServer
PRINT ##################################################################
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CreateSmtpMessageFromEmailFile2
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CheckChildrenCountOutbox
//Only one "Copy from local" function call needed because in addition to the specified messages the SMTP MTM will also attempt to send in the same session any other SMTP messages that appear in the local Outbox folder
RUN_TEST_STEP 	300 T_MsgSmtpServer		SendSmtpMessage 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-SendSmtpMessage
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CheckChildrenCountSentItems
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CheckChildrenCountRemoteInbox0
PRINT ##################################################################
//Messages copied within service from remote INBOX to remote personal folder using a separate IMAP a/c.
RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccount				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CreateImapAccount_B
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-ChangeImap4SubAndSyncSettings_B
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-ConnectAndSyncImapServer_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CheckChildrenCountRemoteInbox_B
RUN_TEST_STEP	300	T_MsgImapServer		CreateImap4Folder				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CreateImap4Folder_B
RUN_TEST_STEP	300	T_MsgImapServer		FindEntryByName					c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-FindEntryByName_B
RUN_TEST_STEP	300	T_MsgImapServer		CopyImapSelectionRemote			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CopyImapSelectionRemote_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CheckChildrenCountRemoteTestFolder0_B
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-DoFullImap4Synchronisation_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CheckChildrenCountRemoteTestFolder1_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckImap4Subscription			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CheckSubscription1_B
RUN_TEST_STEP	300	T_MsgImapServer		SubscribeImap4Folder			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-SubscribeImap4Folder_TestFolder_B
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-DoFullImap4Synchronisation_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckImap4Subscription			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CheckSubscription2_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CheckChildrenCountRemoteTestFolder0_B
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-DisConnectImapServer_B
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-TurnImapIdleOFF
RUN_TEST_STEP	300	T_MsgImapServer		ModifyImapSettings				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-TurnDownloadRulesON
RUN_TEST_STEP	300	T_MsgImapServer		AddImapSyncDLRules				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-AddPerBearerListOfDLRulesINBOX
RUN_TEST_STEP	300	T_MsgImapServer		AddImapSyncDLRules				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-AddPerBearerListOfDLRulesOTHER
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP !Error=-1	300	T_MsgImapServer		FindEntryByName			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-FindEntryByName_TestFolder
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-ChangeImap4SubAndSyncSettings2
PRINT ##################################################################
//2nd phase synchronisation using download rules happens below...
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-ConnectAndSyncImapServer
RUN_TEST_STEP 	300	T_MsgImapServer		FindEntryByName					c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-FindEntryByName_TestFolder
RUN_TEST_STEP	300	T_MsgImapServer		CheckImap4Subscription			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CheckSubscription_TestFolder
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CheckChildrenCountRemoteInbox1
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CheckChildrenCountRemoteTestFolder
RUN_TEST_STEP 	300 T_MsgImapServer  	CompareEmailMessages 			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CompareEmailMessagesInbox
RUN_TEST_STEP 	300 T_MsgImapServer  	CompareEmailMessages 			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-CompareEmailMessagesTestFolder
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0003-DisConnectImapServer
PRINT ##################################################################

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer		ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer		ShutDown

END_TESTCASE	MSG-IMAP-DownloadRulesFetch-0001

//!	@SYMTestCaseID				MSG-IMAP-DownloadRulesFetch-0003
//!	@SYMTestCaseDesc			Positive: Automatically fetch message content using download rules when synchronising using KIMAP4MTMFolderFullSync. (+ve)
//!	@SYMTestPriority			Critical
//!	@SYMTestType				CIT
//! @SYMREQ						6987, 6982
//! @SYMPREQ					1307
//!	@SYMTestStatus				Implemented
//!	@SYMTestCaseDependencies	Requires CED tool to be run over c:\ced_default_ras.cfg to set CommDB as required when using NTRAS for connection to Email servers.
//!	@SYMTestActions				1.	Reset Message Store and Central Repository to default state.
//!								2.	Create IMAP account in Central Repository using standard settings from a configuration file.
//!								3.	Connect and sync to IMAP service using account settings and initialise account on remote IMAP server to default clean state.
//!								4.	Create remote root-level personal folder and remotely subscribe to it.
//!								5.	Disconnect from IMAP service.
//!								6.	Create multiple messages from file and send using SMTP service to remote INBOX.
//!								7.	Populate remote root-level personal folder with multiple messages (Messages copied within service from remote INBOX using a separate IMAP a/c).
//!								8.	Set IMAP service settings to not use IMAP IDLE command.
//!								9.	Modify the email account settings to specify it will use it's defined per bearer type list of email download rules.
//!								10.	Define a per bearer type list of email download rules for both remote Inbox and the personal folder created in step 4.
//!								11.	Connect without sync to IMAP service using account settings. 
//!								12.	Sync down (KIMAP4MTMFolderFullSync) the personal folder created in step 4.
//!								13.	Check that messages are fetched in the personal folder created in step 4 as required according to the download rules defined in step 10 and check that no message headers and content are fetched down in remote Inbox.
//!								14.	Disconnect from IMAP service.
//!
//!	@SYMTestExpectedResults		See step 13.
//!	@SYMAuthor					Sandip Ahluwalia

START_TESTCASE	MSG-IMAP-DownloadRulesFetch-0003

RUN_TEST_STEP	300	T_MsgCommonServer	StartUp
RUN_TEST_STEP	300	T_MsgImapServer		StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer		StartUp

PRINT Setup Begins #####################################################
RUN_TEST_STEP	300	T_MsgCommonServer	InitNtRas						c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-ResetMessageStore
PRINT Setup Completed ##################################################
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccount				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CreateImapAccount
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-ChangeImap4SubAndSyncSettings
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		InitialiseImap4Account			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-InitialiseImap4Account
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-DoFullImap4Synchronisation
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckChildrenCountRemoteInbox0
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		CreateImap4Folder				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CreateImap4Folder
RUN_TEST_STEP	300	T_MsgImapServer		FindEntryByName					c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-FindEntryByName_TestFolder
RUN_TEST_STEP	300	T_MsgImapServer		CheckImap4Subscription			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckSubscription1
RUN_TEST_STEP	300	T_MsgImapServer		SubscribeImap4Folder			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-SubscribeImap4Folder_TestFolder
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-DoFullImap4Synchronisation
RUN_TEST_STEP	300	T_MsgImapServer		CheckImap4Subscription			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckSubscription2
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-DisConnectImapServer
PRINT ##################################################################
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CreateSmtpMessageFromEmailFile2
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckChildrenCountOutbox
//Only one "Copy from local" function call needed because in addition to the specified messages the SMTP MTM will also attempt to send in the same session any other SMTP messages that appear in the local Outbox folder
RUN_TEST_STEP 	300 T_MsgSmtpServer		SendSmtpMessage 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-SendSmtpMessage
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckChildrenCountSentItems
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckChildrenCountRemoteInbox0
PRINT ##################################################################
//Messages copied within service from remote INBOX to remote personal folder using a separate IMAP a/c.
RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccount				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CreateImapAccount_B
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-ChangeImap4SubAndSyncSettings_B
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-ConnectAndSyncImapServer_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckChildrenCountRemoteInbox_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckChildrenCountRemoteTestFolder0_B
RUN_TEST_STEP	300	T_MsgImapServer		CopyImapSelectionRemote			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CopyImapSelectionRemote_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckChildrenCountRemoteTestFolder1_B
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-DoFullImap4Synchronisation_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckChildrenCountRemoteTestFolder1_B
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-DisConnectImapServer_B
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-TurnImapIdleOFF
RUN_TEST_STEP	300	T_MsgImapServer		ModifyImapSettings				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-TurnDownloadRulesON
RUN_TEST_STEP	300	T_MsgImapServer		AddImapSyncDLRules				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-AddPerBearerListOfDLRulesINBOX
RUN_TEST_STEP	300	T_MsgImapServer		AddImapSyncDLRules				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-AddPerBearerListOfDLRulesOTHER
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP	300 T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckChildrenCountRemoteTestFolder0
PRINT ##################################################################
//2nd phase synchronisation using download rules happens below...
RUN_TEST_STEP	300	T_MsgImapServer		ConnectImap4Server				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP	300 T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckChildrenCountRemoteTestFolder0
RUN_TEST_STEP	300	T_MsgImapServer		FolderFullSync					c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-FolderFullSync
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckChildrenCountRemoteTestFolder1
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP !Result=Fail 300 T_MsgImapServer  CompareEmailMessages 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CompareEmailMessagesInbox
RUN_TEST_STEP	300 T_MsgImapServer  	CompareEmailMessages 			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-CompareEmailMessagesTestFolder
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0004-DisConnectImapServer
PRINT ##################################################################

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer		ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer		ShutDown

END_TESTCASE	MSG-IMAP-DownloadRulesFetch-0003

//!	@SYMTestCaseID				MSG-IMAP-DownloadRulesFetch-0005
//!	@SYMTestCaseDesc			Positive: Automatically fetch message content using download rules when synchronising using KIMAP4MTMInboxNewSync. (+ve)
//!	@SYMTestPriority			Critical
//!	@SYMTestType				CIT
//! @SYMREQ						6987, 6982
//! @SYMPREQ					1307
//!	@SYMTestStatus				Implemented
//!	@SYMTestCaseDependencies	Requires CED tool to be run over c:\ced_default_ras.cfg to set CommDB as required when using NTRAS for connection to Email servers.
//!	@SYMTestActions				1.	Reset Message Store and Central Repository to default state.
//!								2.	Create IMAP account in Central Repository using standard settings from a configuration file.
//!								3.	Connect and sync to IMAP service using account settings and initialise account on remote IMAP server to default clean state.
//!								4.	Disconnect from IMAP service.
//!								5.	Create 2 messages from file and send using SMTP service to remote INBOX.
//!								6.	Connect and sync to IMAP service using account settings.
//!								7.	Check that the 2 message headers are fetched in remote INBOX as normal.
//!								8.	Disconnect from IMAP service.
//!								9.	Create further 3 messages from file and send using SMTP service to remote INBOX.
//!								10.	Set IMAP service settings to not use IMAP IDLE command.
//!								11.	Modify the email account settings to specify it will use it's defined per bearer type list of email download rules.
//!								12.	Define a per bearer type list of email download rules for remote Inbox.
//!								13.	Connect without sync to IMAP service using account settings. 
//!								14.	Sync down (KIMAP4MTMInboxNewSync) the remote Inbox.
//!								15.	Check that last 3 messages are fetched in the remote Inbox folder as required according to the download rules defined in step 12 and check that only message headers are still fetched down for the first 2 messages sent in step 5.
//!								16.	Disconnect from IMAP service.
//!
//!	@SYMTestExpectedResults		See step 15.
//!	@SYMAuthor					Sandip Ahluwalia

START_TESTCASE	MSG-IMAP-DownloadRulesFetch-0005

RUN_TEST_STEP	300	T_MsgCommonServer	StartUp
RUN_TEST_STEP	300	T_MsgImapServer		StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer		StartUp

PRINT Setup Begins #####################################################
RUN_TEST_STEP	300	T_MsgCommonServer	InitNtRas						c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-ResetMessageStore
PRINT Setup Completed ##################################################
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccount				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CreateImapAccount
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-ChangeImap4SubAndSyncSettings
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		InitialiseImap4Account			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-InitialiseImap4Account
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-DoFullImap4Synchronisation
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-DisConnectImapServer
PRINT ##################################################################
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CreateSmtpMessageFromEmailFile2
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CheckChildrenCountOutbox1
//Only one "Copy from local" function call needed because in addition to the specified messages the SMTP MTM will also attempt to send in the same session any other SMTP messages that appear in the local Outbox folder
RUN_TEST_STEP 	300 T_MsgSmtpServer		SendSmtpMessage 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-SendSmtpMessages1
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CheckChildrenCountSentItems1
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CheckChildrenCountRemoteInbox1
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-DisConnectImapServer
PRINT ##################################################################
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CreateSmtpMessageFromEmailFile3
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CreateSmtpMessageFromEmailFile4
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CreateSmtpMessageFromEmailFile5
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CheckChildrenCountOutbox2
//Only one "Copy from local" function call needed because in addition to the specified messages the SMTP MTM will also attempt to send in the same session any other SMTP messages that appear in the local Outbox folder
RUN_TEST_STEP 	300 T_MsgSmtpServer		SendSmtpMessage 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-SendSmtpMessages2
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CheckChildrenCountSentItems2
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CheckChildrenCountRemoteInbox1
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-TurnImapIdleOFF
RUN_TEST_STEP	300	T_MsgImapServer		ModifyImapSettings				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-TurnDownloadRulesON
RUN_TEST_STEP	300	T_MsgImapServer		AddImapSyncDLRules				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-AddPerBearerListOfDLRulesINBOX
PRINT ##################################################################
//2nd phase synchronisation using download rules happens below...
RUN_TEST_STEP	300	T_MsgImapServer		ConnectImap4Server				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		InboxNewEmailsSync				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-InboxNewEmailsSync
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CheckChildrenCountRemoteInbox2
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-IsImapMessageHeaderOnly1
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-IsImapMessageHeaderOnly2
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-IsImapMessageHeaderOnly3
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-IsImapMessageHeaderOnly4
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-IsImapMessageHeaderOnly5
RUN_TEST_STEP	300 T_MsgImapServer  	DeleteMessage 					c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-DeleteRemoteMessage1
RUN_TEST_STEP	300 T_MsgImapServer  	DeleteMessage 					c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-DeleteRemoteMessage2
RUN_TEST_STEP	300 T_MsgImapServer  	DeleteMessage		 			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-DeleteLocalMessage1
RUN_TEST_STEP	300 T_MsgImapServer  	DeleteMessage		 			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-DeleteLocalMessage2
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CheckChildrenCountRemoteInbox3
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CheckChildrenCountSentItems3
RUN_TEST_STEP 	300 T_MsgImapServer  	CompareEmailMessages	 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-CompareEmailMessagesInbox
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0005-DisConnectImapServer
PRINT ##################################################################

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer		ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer		ShutDown

END_TESTCASE	MSG-IMAP-DownloadRulesFetch-0005

//!	@SYMTestCaseID				MSG-IMAP-DownloadRulesFetch-0007
//!	@SYMTestCaseDesc			Positive: Automatically fetch message content using download rules when doing a background synchronisation resulting from a new message arriving while in IDLE. (+ve)
//!	@SYMTestPriority			Critical
//!	@SYMTestType				CIT
//! @SYMREQ						6987, 6982
//! @SYMPREQ					1307
//!	@SYMTestStatus				Implemented
//!	@SYMTestCaseDependencies	Requires CED tool to be run over c:\ced_default_ras.cfg to set CommDB as required when using NTRAS for connection to Email servers.
//!								This test case should ONLY run aganist IMAP email servers that DO SUPPORT the IMAP IDLE command.
//!	@SYMTestActions				1.	Reset Message Store and Central Repository to default state.
//!								2.	Create IMAP account in Central Repository using standard settings from a configuration file.
//!								3.	Connect and sync to IMAP service using account settings and initialise account on remote IMAP server to default clean state.
//!								4.	Disconnect from IMAP service.
//!								5.	Set IMAP service settings to use IMAP IDLE command.
//!								6.	Modify the email account settings to specify it will use it's defined per bearer type list of email download rules.
//!								7.	Define a per bearer type list of email download rules for the remote Inbox folder.
//!								8.	Connect without sync to IMAP service using account settings.
//!								9.	Create multiple messages from file and send using SMTP service to remote INBOX.
//!								10.	Check that messages are fetched in the remote Inbox folder as required according to the download rules defined in step 7.
//!								11.	Disconnect from IMAP service.
//!
//!	@SYMTestExpectedResults		See step 10.
//!	@SYMAuthor					Sandip Ahluwalia

START_TESTCASE	MSG-IMAP-DownloadRulesFetch-0007

RUN_TEST_STEP	300	T_MsgCommonServer	StartUp
RUN_TEST_STEP	300	T_MsgImapServer		StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer		StartUp

PRINT Setup Begins #####################################################
RUN_TEST_STEP	300	T_MsgCommonServer	InitNtRas						c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-ResetMessageStore
PRINT Setup Completed ##################################################
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccount				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-CreateImapAccount
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-ChangeImap4SubAndSyncSettings
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		InitialiseImap4Account			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-InitialiseImap4Account
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-DoFullImap4Synchronisation
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-DisConnectImapServer
PRINT ##################################################################
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-CreateSmtpMessageFromEmailFile2
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-CheckChildrenCountOutbox
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-TurnImapIdleON
RUN_TEST_STEP	300	T_MsgImapServer		ModifyImapSettings				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-TurnDownloadRulesON
RUN_TEST_STEP	300	T_MsgImapServer		AddImapSyncDLRules				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-AddPerBearerListOfDLRulesINBOX
PRINT ##################################################################
//2nd phase synchronisation using download rules happens below...
RUN_TEST_STEP	300	T_MsgImapServer		ConnectImap4Server				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-CheckChildrenCountRemoteInbox0
//Only one "Copy from local" function call needed because in addition to the specified messages the SMTP MTM will also attempt to send in the same session any other SMTP messages that appear in the local Outbox folder
RUN_TEST_STEP 	300 T_MsgSmtpServer		SendSmtpMessage 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-SendSmtpMessage
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-CheckChildrenCountSentItems
// Delay to allow the email message to be recieved
DELAY 30000
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-CheckChildrenCountRemoteInbox1
RUN_TEST_STEP 	300 T_MsgImapServer  	CompareEmailMessages 			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-CompareEmailMessagesInbox
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0006-DisConnectImapServer
PRINT ##################################################################

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer		ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer		ShutDown

END_TESTCASE	MSG-IMAP-DownloadRulesFetch-0007

//!	@SYMTestCaseID				MSG-IMAP-DownloadRulesFetch-0008
//!	@SYMTestCaseDesc			Positive: Maintain default behaviour when synchronising using KIMAP4MTMConnectAndSynchronise with settings indicating download rules should not be used. (+ve)
//!	@SYMTestPriority			Critical
//!	@SYMTestType				CIT
//! @SYMREQ						6987, 6982
//! @SYMPREQ					1307
//!	@SYMTestStatus				Implemented
//!	@SYMTestCaseDependencies	Requires CED tool to be run over c:\ced_default_ras.cfg to set CommDB as required when using NTRAS for connection to Email servers.
//!	@SYMTestActions				1.	Reset Message Store and Central Repository to default state.
//!								2.	Create IMAP account in Central Repository using standard settings from a configuration file.
//!								3.	Connect and sync to IMAP service using account settings and initialise account on remote IMAP server to default clean state.
//!								4.	Disconnect from IMAP service.
//!								5.	Create multiple messages from file and send using SMTP service to remote INBOX.
//!								6.	Create remote root-level personal folder with multiple messages (messages copied within service from INBOX using a separate IMAP a/c).
//!								7.	Set IMAP service settings to not use IMAP IDLE command.
//!								8.	Check the email account settings specify it will not use it's defined per bearer type list of email download rules.
//!								9.	Define a per bearer type list of email download rules for both remote Inbox and the personal folder created in step 6.
//!								10.	Connect and sync (KIMAP4MTMConnectAndSynchronise) to IMAP service using account settings and wait for background synchronisation to complete.
//!								11.	Check that only message headers are fetched in remote Inbox and the personal folder created in step 6 as required.
//!								12.	Disconnect from IMAP service.
//!
//!	@SYMTestExpectedResults		See step 11.
//!	@SYMAuthor					Sandip Ahluwalia

START_TESTCASE	MSG-IMAP-DownloadRulesFetch-0008

RUN_TEST_STEP	300	T_MsgCommonServer	StartUp
RUN_TEST_STEP	300	T_MsgImapServer		StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer		StartUp

PRINT Setup Begins #####################################################
RUN_TEST_STEP	300	T_MsgCommonServer	InitNtRas						c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-ResetMessageStore
PRINT Setup Completed ##################################################
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccount				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CreateImapAccount
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-ChangeImap4SubAndSyncSettings
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		InitialiseImap4Account			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-InitialiseImap4Account
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-DoFullImap4Synchronisation
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-DisConnectImapServer
PRINT ##################################################################
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CreateSmtpMessageFromEmailFile2
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CheckChildrenCountOutbox
//Only one "Copy from local" function call needed because in addition to the specified messages the SMTP MTM will also attempt to send in the same session any other SMTP messages that appear in the local Outbox folder
RUN_TEST_STEP 	300 T_MsgSmtpServer		SendSmtpMessage 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-SendSmtpMessage
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CheckChildrenCountSentItems
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CheckChildrenCountRemoteInbox0
PRINT ##################################################################
//Messages copied within service from remote INBOX to remote personal folder using a separate IMAP a/c.
RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccount				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CreateImapAccount_B
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-ChangeImap4SubAndSyncSettings_B
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-ConnectAndSyncImapServer_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CheckChildrenCountRemoteInbox_B
RUN_TEST_STEP	300	T_MsgImapServer		CreateImap4Folder				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CreateImap4Folder_B
RUN_TEST_STEP	300	T_MsgImapServer		FindEntryByName					c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-FindEntryByName_B
RUN_TEST_STEP	300	T_MsgImapServer		CopyImapSelectionRemote			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CopyImapSelectionRemote_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CheckChildrenCountRemoteTestFolder0_B
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-DoFullImap4Synchronisation_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CheckChildrenCountRemoteTestFolder1_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckImap4Subscription			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CheckSubscription1_B
RUN_TEST_STEP	300	T_MsgImapServer		SubscribeImap4Folder			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-SubscribeImap4Folder_TestFolder_B
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-DoFullImap4Synchronisation_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckImap4Subscription			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CheckSubscription2_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CheckChildrenCountRemoteTestFolder0_B
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-DisConnectImapServer_B
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-TurnImapIdleOFF
RUN_TEST_STEP	300	T_MsgImapServer		CheckImapDLRulesSetting			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CheckImapDLRulesSetting
RUN_TEST_STEP	300	T_MsgImapServer		AddImapSyncDLRules				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-AddPerBearerListOfDLRulesINBOX
RUN_TEST_STEP	300	T_MsgImapServer		AddImapSyncDLRules				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-AddPerBearerListOfDLRulesOTHER
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP !Error=-1	300	T_MsgImapServer		FindEntryByName			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-FindEntryByName_TestFolder
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-ChangeImap4SubAndSyncSettings2
PRINT ##################################################################
//2nd phase synchronisation using download rules happens below...
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-ConnectAndSyncImapServer
RUN_TEST_STEP 	300	T_MsgImapServer		FindEntryByName					c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-FindEntryByName_TestFolder
RUN_TEST_STEP	300	T_MsgImapServer		CheckImap4Subscription			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CheckSubscription_TestFolder
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CheckChildrenCountRemoteInbox1
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-CheckChildrenCountRemoteTestFolder
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-IsImapMessageHeaderOnly1
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-IsImapMessageHeaderOnly2
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-IsImapMessageHeaderOnly3
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-IsImapMessageHeaderOnly4
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0007-DisConnectImapServer
PRINT ##################################################################

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer		ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer		ShutDown

END_TESTCASE	MSG-IMAP-DownloadRulesFetch-0008

//!	@SYMTestCaseID				MSG-IMAP-DownloadRulesFetch-0010
//!	@SYMTestCaseDesc			Positive: Maintain default behaviour when synchronising using KIMAP4MTMFolderFullSync with settings indicating download rules should not be used. (+ve)
//!	@SYMTestPriority			Critical
//!	@SYMTestType				CIT
//! @SYMREQ						6987, 6982
//! @SYMPREQ					1307
//!	@SYMTestStatus				Implemented
//!	@SYMTestCaseDependencies	Requires CED tool to be run over c:\ced_default_ras.cfg to set CommDB as required when using NTRAS for connection to Email servers.
//!	@SYMTestActions				1.	Reset Message Store and Central Repository to default state.
//!								2.	Create IMAP account in Central Repository using standard settings from a configuration file.
//!								3.	Connect and sync to IMAP service using account settings and initialise account on remote IMAP server to default clean state.
//!								4.	Create remote root-level personal folder and remotely subscribe to it.
//!								5.	Disconnect from IMAP service.
//!								6.	Create multiple messages from file and send using SMTP service to remote INBOX.
//!								7.	Populate remote root-level personal folder with multiple messages (Messages copied within service from remote INBOX using a separate IMAP a/c).
//!								8.	Set IMAP service settings to not use IMAP IDLE command.
//!								9.	Check the email account settings specify it will not use it's defined per bearer type list of email download rules.
//!								10.	Define a per bearer type list of email download rules for both remote Inbox and the personal folder created in step 4.
//!								11.	Connect without sync to IMAP service using account settings. 
//!								12.	Sync down (KIMAP4MTMFolderFullSync) the personal folder created in step 4.
//!								13.	Check that only message headers are fetched in the personal folder created in step 4 as required and check that no message headers and content are fetched down in remote Inbox.
//!								14.	Disconnect from IMAP service.
//!
//!	@SYMTestExpectedResults		See step 13.
//!	@SYMAuthor					Sandip Ahluwalia

START_TESTCASE	MSG-IMAP-DownloadRulesFetch-0010

RUN_TEST_STEP	300	T_MsgCommonServer	StartUp
RUN_TEST_STEP	300	T_MsgImapServer		StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer		StartUp

PRINT Setup Begins #####################################################
RUN_TEST_STEP	300	T_MsgCommonServer	InitNtRas						c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-ResetMessageStore
PRINT Setup Completed ##################################################
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccount				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CreateImapAccount
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-ChangeImap4SubAndSyncSettings
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		InitialiseImap4Account			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-InitialiseImap4Account
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-DoFullImap4Synchronisation
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckChildrenCountRemoteInbox0
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		CreateImap4Folder				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CreateImap4Folder
RUN_TEST_STEP	300	T_MsgImapServer		FindEntryByName					c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-FindEntryByName_TestFolder
RUN_TEST_STEP	300	T_MsgImapServer		CheckImap4Subscription			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckSubscription1
RUN_TEST_STEP	300	T_MsgImapServer		SubscribeImap4Folder			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-SubscribeImap4Folder_TestFolder
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-DoFullImap4Synchronisation
RUN_TEST_STEP	300	T_MsgImapServer		CheckImap4Subscription			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckSubscription2
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-DisConnectImapServer
PRINT ##################################################################
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CreateSmtpMessageFromEmailFile2
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckChildrenCountOutbox
//Only one "Copy from local" function call needed because in addition to the specified messages the SMTP MTM will also attempt to send in the same session any other SMTP messages that appear in the local Outbox folder
RUN_TEST_STEP 	300 T_MsgSmtpServer		SendSmtpMessage 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-SendSmtpMessage
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckChildrenCountSentItems
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckChildrenCountRemoteInbox0
PRINT ##################################################################
//Messages copied within service from remote INBOX to remote personal folder using a separate IMAP a/c.
RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccount				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CreateImapAccount_B
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-ChangeImap4SubAndSyncSettings_B
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-ConnectAndSyncImapServer_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckChildrenCountRemoteInbox_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckChildrenCountRemoteTestFolder0_B
RUN_TEST_STEP	300	T_MsgImapServer		CopyImapSelectionRemote			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CopyImapSelectionRemote_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckChildrenCountRemoteTestFolder1_B
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-DoFullImap4Synchronisation_B
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckChildrenCountRemoteTestFolder1_B
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-DisConnectImapServer_B
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-TurnImapIdleOFF
RUN_TEST_STEP	300	T_MsgImapServer		CheckImapDLRulesSetting			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckImapDLRulesSetting
RUN_TEST_STEP	300	T_MsgImapServer		AddImapSyncDLRules				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-AddPerBearerListOfDLRulesINBOX
RUN_TEST_STEP	300	T_MsgImapServer		AddImapSyncDLRules				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-AddPerBearerListOfDLRulesOTHER
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP	300 T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckChildrenCountRemoteTestFolder0
PRINT ##################################################################
//2nd phase synchronisation using download rules happens below...
RUN_TEST_STEP	300	T_MsgImapServer		ConnectImap4Server				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP	300 T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckChildrenCountRemoteTestFolder0
RUN_TEST_STEP	300	T_MsgImapServer		FolderFullSync					c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-FolderFullSync
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckChildrenCountRemoteTestFolder1
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-IsImapMessageHeaderOnly1
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-IsImapMessageHeaderOnly2
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0008-DisConnectImapServer
PRINT ##################################################################

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer		ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer		ShutDown

END_TESTCASE	MSG-IMAP-DownloadRulesFetch-0010

//!	@SYMTestCaseID				MSG-IMAP-DownloadRulesFetch-0012
//!	@SYMTestCaseDesc			Positive: Maintain default behaviour when synchronising using KIMAP4MTMInboxNewSync with settings indicating download rules should not be used. (+ve)
//!	@SYMTestPriority			Critical
//!	@SYMTestType				CIT
//! @SYMREQ						6987, 6982
//! @SYMPREQ					1307
//!	@SYMTestStatus				Implemented
//!	@SYMTestCaseDependencies	Requires CED tool to be run over c:\ced_default_ras.cfg to set CommDB as required when using NTRAS for connection to Email servers.
//!	@SYMTestActions				1.	Reset Message Store and Central Repository to default state.
//!								2.	Create IMAP account in Central Repository using standard settings from a configuration file.
//!								3.	Connect and sync to IMAP service using account settings and initialise account on remote IMAP server to default clean state.
//!								4.	Disconnect from IMAP service.
//!								5.	Create 2 messages from file and send using SMTP service to remote INBOX.
//!								6.	Connect and sync to IMAP service using account settings.
//!								7.	Check that the 2 message headers are fetched in remote INBOX as normal.
//!								8.	Disconnect from IMAP service.
//!								9.	Create further 3 messages from file and send using SMTP service to remote INBOX.
//!								10.	Set IMAP service settings to not use IMAP IDLE command.
//!								11.	Check the email account settings specify it will not use it's defined per bearer type list of email download rules.
//!								12.	Define a per bearer type list of email download rules for remote Inbox.
//!								13.	Connect without sync to IMAP service using account settings. 
//!								14.	Sync down (KIMAP4MTMInboxNewSync) the remote Inbox.
//!								15.	Check that only message headers are fetched in the remote Inbox folder as required for first 2 messages sent in step 5 and last 3 messages sent in step 9.
//!								16.	Disconnect from IMAP service.
//!
//!	@SYMTestExpectedResults		See step 15.
//!	@SYMAuthor					Sandip Ahluwalia

START_TESTCASE	MSG-IMAP-DownloadRulesFetch-0012

RUN_TEST_STEP	300	T_MsgCommonServer	StartUp
RUN_TEST_STEP	300	T_MsgImapServer		StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer		StartUp

PRINT Setup Begins #####################################################
RUN_TEST_STEP	300	T_MsgCommonServer	InitNtRas						c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-ResetMessageStore
PRINT Setup Completed ##################################################
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccount				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CreateImapAccount
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-ChangeImap4SubAndSyncSettings
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		InitialiseImap4Account			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-InitialiseImap4Account
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-DoFullImap4Synchronisation
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-DisConnectImapServer
PRINT ##################################################################
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CreateSmtpMessageFromEmailFile2
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CheckChildrenCountOutbox1
//Only one "Copy from local" function call needed because in addition to the specified messages the SMTP MTM will also attempt to send in the same session any other SMTP messages that appear in the local Outbox folder
RUN_TEST_STEP 	300 T_MsgSmtpServer		SendSmtpMessage 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-SendSmtpMessages1
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CheckChildrenCountSentItems1
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CheckChildrenCountRemoteInbox1
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-DisConnectImapServer
PRINT ##################################################################
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CreateSmtpMessageFromEmailFile3
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CreateSmtpMessageFromEmailFile4
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CreateSmtpMessageFromEmailFile5
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CheckChildrenCountOutbox2
//Only one "Copy from local" function call needed because in addition to the specified messages the SMTP MTM will also attempt to send in the same session any other SMTP messages that appear in the local Outbox folder
RUN_TEST_STEP 	300 T_MsgSmtpServer		SendSmtpMessage 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-SendSmtpMessages2
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CheckChildrenCountSentItems2
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CheckChildrenCountRemoteInbox1
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-TurnImapIdleOFF
RUN_TEST_STEP	300	T_MsgImapServer		CheckImapDLRulesSetting	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CheckImapDLRulesSetting
RUN_TEST_STEP	300	T_MsgImapServer		AddImapSyncDLRules				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-AddPerBearerListOfDLRulesINBOX
PRINT ##################################################################
//2nd phase synchronisation using download rules happens below...
RUN_TEST_STEP	300	T_MsgImapServer		ConnectImap4Server				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		InboxNewEmailsSync				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-InboxNewEmailsSync
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-CheckChildrenCountRemoteInbox2
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-IsImapMessageHeaderOnly1
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-IsImapMessageHeaderOnly2
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-IsImapMessageHeaderOnly3
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-IsImapMessageHeaderOnly4
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-IsImapMessageHeaderOnly5
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0009-DisConnectImapServer
PRINT ##################################################################

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer		ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer		ShutDown

END_TESTCASE	MSG-IMAP-DownloadRulesFetch-0012

//!	@SYMTestCaseID				MSG-IMAP-DownloadRulesFetch-0014
//!	@SYMTestCaseDesc			Positive: Maintain default behaviour during background synchronisation resulting from a new message arriving while in IDLE when settings indicate that download rules should not be used. (+ve)
//!	@SYMTestPriority			Critical
//!	@SYMTestType				CIT
//! @SYMREQ						6987, 6982
//! @SYMPREQ					1307
//!	@SYMTestStatus				Implemented
//!	@SYMTestCaseDependencies	Requires CED tool to be run over c:\ced_default_ras.cfg to set CommDB as required when using NTRAS for connection to Email servers.
//!								This test case should ONLY run aganist IMAP email servers that DO SUPPORT the IMAP IDLE command.
//!	@SYMTestActions				1.	Reset Message Store and Central Repository to default state.
//!								2.	Create IMAP account in Central Repository using standard settings from a configuration file.
//!								3.	Connect and sync to IMAP service using account settings and initialise account on remote IMAP server to default clean state.
//!								4.	Disconnect from IMAP service.
//!								5.	Set IMAP service settings to use IMAP IDLE command.
//!								6.	Check the email account settings specify it will not use it's defined per bearer type list of email download rules.
//!								7.	Define a per bearer type list of email download rules for the remote Inbox folder.
//!								8.	Connect without sync to IMAP service using account settings.
//!								9.	Create multiple messages from file and send using SMTP service to remote INBOX.
//!								10.	Check that only message headers are fetched in the remote Inbox folder as required.
//!								11.	Disconnect from IMAP service.
//!
//!	@SYMTestExpectedResults		See step 10.
//!	@SYMAuthor					Sandip Ahluwalia

START_TESTCASE	MSG-IMAP-DownloadRulesFetch-0014

RUN_TEST_STEP	300	T_MsgCommonServer	StartUp
RUN_TEST_STEP	300	T_MsgImapServer		StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer		StartUp

PRINT Setup Begins #####################################################
RUN_TEST_STEP	300	T_MsgCommonServer	InitNtRas						c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-ResetMessageStore
PRINT Setup Completed ##################################################
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccount				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-CreateImapAccount
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-ChangeImap4SubAndSyncSettings
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		InitialiseImap4Account			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-InitialiseImap4Account
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-DoFullImap4Synchronisation
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-DisConnectImapServer
PRINT ##################################################################
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-CreateSmtpMessageFromEmailFile2
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-CheckChildrenCountOutbox
PRINT ##################################################################
RUN_TEST_STEP	300	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-TurnImapIdleON
RUN_TEST_STEP	300	T_MsgImapServer		CheckImapDLRulesSetting			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-CheckImapDLRulesSetting
RUN_TEST_STEP	300	T_MsgImapServer		AddImapSyncDLRules				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-AddPerBearerListOfDLRulesINBOX
PRINT ##################################################################
//2nd phase synchronisation using download rules happens below...
RUN_TEST_STEP	300	T_MsgImapServer		ConnectImap4Server				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-CheckChildrenCountRemoteInbox0
//Only one "Copy from local" function call needed because in addition to the specified messages the SMTP MTM will also attempt to send in the same session any other SMTP messages that appear in the local Outbox folder
RUN_TEST_STEP 	300 T_MsgSmtpServer		SendSmtpMessage 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-SendSmtpMessage
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-CheckChildrenCountSentItems
// Delay to allow the email message to be recieved
DELAY 30000
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-CheckChildrenCountRemoteInbox1
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-IsImapMessageHeaderOnly1
RUN_TEST_STEP	300 T_MsgImapServer  	IsImapMessageHeaderOnly 		c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-IsImapMessageHeaderOnly2
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\downloadrules\msg-imap-downloadrules1.ini	0010-DisConnectImapServer
PRINT ##################################################################

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer		ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer		ShutDown

END_TESTCASE	MSG-IMAP-DownloadRulesFetch-0014
