Index: mail-vfolder.c
===================================================================
--- mail-vfolder.c	(revision 34333)
+++ mail-vfolder.c	(working copy)
@@ -403,7 +403,7 @@
 
 	/* This is a bit of a hack, but really the only way it can be done at the moment. */
 
-	if ((store->flags & (CAMEL_STORE_VTRASH|CAMEL_STORE_VJUNK)) == 0)
+	if ((store->flags & (CAMEL_STORE_VTRASH|CAMEL_STORE_VJUNK|CAMEL_STORE_VARCHIVED)) == 0)
 		return FALSE;
 
 	url = camel_url_new(uri, NULL);
@@ -415,13 +415,17 @@
 		res = (((store->flags & CAMEL_STORE_VTRASH)
 			&& strcmp(url->fragment, CAMEL_VTRASH_NAME) == 0)
 		       || ((store->flags & CAMEL_STORE_VJUNK)
-			   && strcmp(url->fragment, CAMEL_VJUNK_NAME) == 0));
+			   && strcmp(url->fragment, CAMEL_VJUNK_NAME) == 0)
+		       || ((store->flags & CAMEL_STORE_VARCHIVED)
+			   && strcmp(url->fragment, CAMEL_VARCHIVED_NAME) == 0));
 	} else {
 		res = url->path
 			&& (((store->flags & CAMEL_STORE_VTRASH)
 			     && strcmp(url->path, "/" CAMEL_VTRASH_NAME) == 0)
 			    || ((store->flags & CAMEL_STORE_VJUNK)
-				&& strcmp(url->path, "/" CAMEL_VJUNK_NAME) == 0));
+				&& strcmp(url->path, "/" CAMEL_VJUNK_NAME) == 0)
+			    || ((store->flags & CAMEL_STORE_VARCHIVED)
+				&& strcmp(url->path, "/" CAMEL_VARCHIVED_NAME) == 0));
 	}
 
 	camel_url_free(url);
Index: em-folder-tree.c
===================================================================
--- em-folder-tree.c	(revision 34333)
+++ em-folder-tree.c	(working copy)
@@ -273,6 +273,7 @@
 	FOLDER_ICON_SHARED_TO_ME,
 	FOLDER_ICON_SHARED_BY_ME,
 	FOLDER_ICON_SENT,
+	FOLDER_ICON_ARCHIVED,
 	FOLDER_ICON_LAST
 };
 
@@ -293,6 +294,7 @@
 		folder_icons[FOLDER_ICON_OUTBOX] = e_icon_factory_get_icon ("stock_outbox", E_ICON_SIZE_MENU);
 		folder_icons[FOLDER_ICON_TRASH] = e_icon_factory_get_icon ("user-trash", E_ICON_SIZE_MENU);
 		folder_icons[FOLDER_ICON_JUNK] = e_icon_factory_get_icon ("mail-mark-junk", E_ICON_SIZE_MENU);
+		folder_icons[FOLDER_ICON_ARCHIVED] = e_icon_factory_get_icon ("gtk-cdrom", E_ICON_SIZE_MENU);
 		folder_icons[FOLDER_ICON_SHARED_TO_ME] = e_icon_factory_get_icon ("stock_shared-to-me", E_ICON_SIZE_MENU);
 		folder_icons[FOLDER_ICON_SHARED_BY_ME] = e_icon_factory_get_icon ("stock_shared-by-me", E_ICON_SIZE_MENU);
 		folder_icons[FOLDER_ICON_SENT] = e_icon_factory_get_icon ("stock_sent-mail", E_ICON_SIZE_MENU);
@@ -316,6 +318,9 @@
 		case CAMEL_FOLDER_TYPE_JUNK:
 			pixbuf = folder_icons[FOLDER_ICON_JUNK];
 			break;
+		case CAMEL_FOLDER_TYPE_ARCHIVED:
+			pixbuf = folder_icons[FOLDER_ICON_ARCHIVED];
+			break;
 		case CAMEL_FOLDER_TYPE_SENT:
 			pixbuf = folder_icons[FOLDER_ICON_SENT];
 			break;
@@ -1132,9 +1137,11 @@
 		if (!strncmp (uri, "vfolder:", 8) && !strcmp (full_name, CAMEL_UNMATCHED_NAME))
 			goto done;
 		
-		/* don't allow copying/moving into a vTrash/vJunk folder */
+		/* don't allow copying/moving into a vTrash/vJunk/vArchived folder */
+		/* Need to change if we allow drag&drop to archived folder */
 		if (!strcmp (full_name, CAMEL_VTRASH_NAME)
-		    || !strcmp (full_name, CAMEL_VJUNK_NAME))
+		    || !strcmp (full_name, CAMEL_VJUNK_NAME) 
+		    || !strcmp (full_name, CAMEL_VARCHIVED_NAME))
 			goto done;
 	}
 	
@@ -1198,9 +1205,10 @@
 				goto done;
 			}
 			
-			/* don't allow copying/moving of any vTrash/vJunk folder nor maildir 'inbox' */
+			/* don't allow copying/moving of any vTrash/vJunk/vArchived folder nor maildir 'inbox' */
 			if (strcmp(url_path, CAMEL_VTRASH_NAME) == 0
 			    || strcmp(url_path, CAMEL_VJUNK_NAME) == 0
+			    || strcmp(url_path, CAMEL_VARCHIVED_NAME) == 0
 			    /* Dont allow drag from maildir 'inbox' */
 			    || strcmp(url_path, ".") == 0) {
 				camel_url_free(url);
Index: em-folder-view.c
===================================================================
--- em-folder-view.c	(revision 34333)
+++ em-folder-view.c	(working copy)
@@ -992,6 +992,34 @@
 }
 
 static void
+emfv_popup_mark_archive(EPopup *ep, EPopupItem *pitem, void *data)
+{
+	EMFolderView *emfv = data;
+/* 	char * dest_folder_uri = g_malloc(sizeof(char) * 1000); */
+/* 	GPtrArray *uids; */
+	
+	em_folder_view_mark_selected(emfv, CAMEL_MESSAGE_ARCHIVED|CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_ARCHIVED);
+
+	/* We have to check for gconf entry if user set the remove from server then call the following function with deleted flag as 1 */
+/*   	sprintf(dest_folder_uri, "imap://wlakke@blr-dsmaster1/.Archived/%s", emfv->folder->name);   */
+/* 	/\* free (dest_folder_name); *\/ */
+	
+/* 	uids = message_list_get_selected(emfv->list); */
+	
+/* 	printf(" WHAT FOLDER FROM MESAGE LIST=%s\n", dest_folder_uri); */
+	
+/* 	/\* Third flag is delete from source *\/ */
+/* 	mail_transfer_messages(emfv->folder, uids, 0, dest_folder_uri, 0, NULL, NULL);   */
+}
+
+static void
+emfv_popup_mark_unarchive(EPopup *ep, EPopupItem *pitem, void *data)
+{
+	EMFolderView *emfv = data;
+	em_folder_view_mark_selected(emfv, CAMEL_MESSAGE_ARCHIVED|CAMEL_MESSAGE_DELETED, 0);
+}
+
+static void
 emfv_popup_mark_important(EPopup *ep, EPopupItem *pitem, void *data)
 {
 	EMFolderView *emfv = data;
@@ -1238,11 +1266,13 @@
 	{ E_POPUP_BAR, "50.emfv", NULL, NULL, NULL, NULL },
 	{ E_POPUP_ITEM, "50.emfv.00", N_("Mar_k as Read"), emfv_popup_mark_read, NULL, "mail-read", EM_POPUP_SELECT_MARK_READ|EM_FOLDER_VIEW_SELECT_LISTONLY },
 	{ E_POPUP_ITEM, "50.emfv.01", N_("Mark as _Unread"), emfv_popup_mark_unread, NULL, "mail-unread", EM_POPUP_SELECT_MARK_UNREAD|EM_FOLDER_VIEW_SELECT_LISTONLY },
-	{ E_POPUP_ITEM, "50.emfv.02", N_("Mark as _Important"), emfv_popup_mark_important, NULL, "mail-mark-important", EM_POPUP_SELECT_MARK_IMPORTANT|EM_FOLDER_VIEW_SELECT_LISTONLY },
-	{ E_POPUP_ITEM, "50.emfv.03", N_("Mark as Un_important"), emfv_popup_mark_unimportant, NULL, NULL, EM_POPUP_SELECT_MARK_UNIMPORTANT|EM_FOLDER_VIEW_SELECT_LISTONLY },
-	{ E_POPUP_ITEM, "50.emfv.04", N_("Mark as _Junk"), emfv_popup_mark_junk, NULL, "mail-mark-junk", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY|EM_POPUP_SELECT_JUNK },
-	{ E_POPUP_ITEM, "50.emfv.05", N_("Mark as _Not Junk"), emfv_popup_mark_nojunk, NULL, "mail-mark-notjunk", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY|EM_POPUP_SELECT_NOT_JUNK },
-	{ E_POPUP_ITEM, "50.emfv.06", N_("Mark for Follo_w Up..."), emfv_popup_flag_followup, NULL, "stock_mail-flag-for-followup",  EM_POPUP_SELECT_FLAG_FOLLOWUP|EM_FOLDER_VIEW_SELECT_LISTONLY },
+	{ E_POPUP_ITEM, "50.emfv.02", N_("Mark as _Archive"), emfv_popup_mark_archive, NULL, "gtk-cdrom", EM_POPUP_SELECT_MARK_ARCHIVED|EM_FOLDER_VIEW_SELECT_LISTONLY },
+	{ E_POPUP_ITEM, "50.emfv.03", N_("Mark as _UnArchive"), emfv_popup_mark_unarchive, NULL, "gtk-cdrom", EM_POPUP_SELECT_MARK_UNARCHIVED|EM_FOLDER_VIEW_SELECT_LISTONLY },
+	{ E_POPUP_ITEM, "50.emfv.04", N_("Mark as _Important"), emfv_popup_mark_important, NULL, "emblem-important", EM_POPUP_SELECT_MARK_IMPORTANT|EM_FOLDER_VIEW_SELECT_LISTONLY },
+	{ E_POPUP_ITEM, "50.emfv.05", N_("Mark as Un_important"), emfv_popup_mark_unimportant, NULL, NULL, EM_POPUP_SELECT_MARK_UNIMPORTANT|EM_FOLDER_VIEW_SELECT_LISTONLY },
+	{ E_POPUP_ITEM, "50.emfv.06", N_("Mark as _Junk"), emfv_popup_mark_junk, NULL, "mail-mark-junk", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY|EM_POPUP_SELECT_JUNK },
+	{ E_POPUP_ITEM, "50.emfv.07", N_("Mark as _Not Junk"), emfv_popup_mark_nojunk, NULL, "mail-mark-notjunk", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY|EM_POPUP_SELECT_NOT_JUNK },
+	{ E_POPUP_ITEM, "50.emfv.08", N_("Mark for Follo_w Up..."), emfv_popup_flag_followup, NULL, "stock_mail-flag-for-followup",  EM_POPUP_SELECT_FLAG_FOLLOWUP|EM_FOLDER_VIEW_SELECT_LISTONLY },
 
 	{ E_POPUP_SUBMENU, "60.label.00", N_("_Label"), NULL, NULL, NULL, EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY },
 	{ E_POPUP_ITEM, "60.label.00/00.label", N_("_None"), emfv_popup_label_clear, NULL, NULL, EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY },
@@ -1383,6 +1413,8 @@
 EMFV_MAP_CALLBACK(emfv_message_reply_sender, emfv_popup_reply_sender)
 EMFV_MAP_CALLBACK(emfv_message_mark_read, emfv_popup_mark_read)
 EMFV_MAP_CALLBACK(emfv_message_mark_unread, emfv_popup_mark_unread)
+EMFV_MAP_CALLBACK(emfv_message_mark_archive, emfv_popup_mark_archive)
+EMFV_MAP_CALLBACK(emfv_message_mark_unarchive, emfv_popup_mark_unarchive)
 EMFV_MAP_CALLBACK(emfv_message_mark_important, emfv_popup_mark_important)
 EMFV_MAP_CALLBACK(emfv_message_mark_unimportant, emfv_popup_mark_unimportant)
 EMFV_MAP_CALLBACK(emfv_message_mark_junk, emfv_popup_mark_junk)
@@ -1903,6 +1935,8 @@
 	BONOBO_UI_UNSAFE_VERB ("MessageRedirect", emfv_message_redirect),
 	BONOBO_UI_UNSAFE_VERB ("MessageMarkAsRead", emfv_message_mark_read),
 	BONOBO_UI_UNSAFE_VERB ("MessageMarkAsUnRead", emfv_message_mark_unread),
+	BONOBO_UI_UNSAFE_VERB ("MessageMarkAsArchive", emfv_message_mark_archive),
+	BONOBO_UI_UNSAFE_VERB ("MessageMarkAsUnArchive", emfv_message_mark_unarchive), 
 	BONOBO_UI_UNSAFE_VERB ("MessageMarkAsImportant", emfv_message_mark_important),
 	BONOBO_UI_UNSAFE_VERB ("MessageMarkAsUnimportant", emfv_message_mark_unimportant),
 	BONOBO_UI_UNSAFE_VERB ("MessageMarkAsJunk", emfv_message_mark_junk),
@@ -1965,6 +1999,8 @@
 	E_PIXMAP ("/commands/MessageMarkAsNotJunk", "mail-mark-notjunk", E_ICON_SIZE_MENU),
 	E_PIXMAP ("/commands/MessageMarkAsRead", "mail-read", E_ICON_SIZE_MENU),
 	E_PIXMAP ("/commands/MessageMarkAsUnRead", "mail-unread", E_ICON_SIZE_MENU),
+	E_PIXMAP ("/commands/MessageMarkAsArchive", "gtk-cdrom", E_ICON_SIZE_MENU),
+ 	E_PIXMAP ("/commands/MessageMarkAsUnArchive", "stock_mail_read", E_ICON_SIZE_MENU), 
 	E_PIXMAP ("/commands/MessageMove", "stock_mail-move", E_ICON_SIZE_MENU),
 	E_PIXMAP ("/commands/MessageReplyAll", "mail-reply-all", E_ICON_SIZE_MENU),
 	E_PIXMAP ("/commands/MessageReplySender", "mail-reply-sender", E_ICON_SIZE_MENU),
Index: mail-folder-cache.c
===================================================================
--- mail-folder-cache.c	(revision 34333)
+++ mail-folder-cache.c	(working copy)
@@ -395,7 +395,13 @@
 	if (mfi) {
 		update_1folder(mfi, 0, fi);
 	} else {
+/* 		if( strcmp(si->store->parent_object.provider->name, "IMAP") && (!strcmp(fi->name, "Archived")) { */
+/* 			printf("||||||||||||||| REMOVING ARCHIVED FOLDER ON ||||||||||||||. \n"); */
+/* 			return ; */
+/* 		} */
+		
 		d(printf("Adding new folder: %s (%s)\n", fi->full_name, fi->uri));
+		/* printf("||||||||||||| Adding new folder: %s (%s)||||||||||||\n", fi->full_name, fi->uri); */
 		mfi = g_malloc0(sizeof(*mfi));
 		mfi->full_name = g_strdup(fi->full_name);
 		mfi->uri = g_strdup(fi->uri);
Index: em-popup.c
===================================================================
--- em-popup.c	(revision 34333)
+++ em-popup.c	(working copy)
@@ -221,6 +221,11 @@
 		else
 			mask &= ~EM_POPUP_SELECT_MARK_READ;
 
+		if(flags & CAMEL_MESSAGE_ARCHIVED)
+			mask &= ~EM_POPUP_SELECT_MARK_UNARCHIVED;
+		else
+			mask &= ~EM_POPUP_SELECT_MARK_ARCHIVED;
+
 		if (store->flags & CAMEL_STORE_VJUNK) {
 			if ((flags & CAMEL_MESSAGE_JUNK))
 				mask &= ~EM_POPUP_SELECT_NOT_JUNK;
@@ -846,6 +851,8 @@
 	{ "many", EM_POPUP_SELECT_MANY },
 	{ "mark_read", EM_POPUP_SELECT_MARK_READ },
 	{ "mark_unread", EM_POPUP_SELECT_MARK_UNREAD },
+	{ "mark_archive", EM_POPUP_SELECT_MARK_ARCHIVED },
+	{ "mark_unarchive", EM_POPUP_SELECT_MARK_UNARCHIVED },
 	{ "delete", EM_POPUP_SELECT_DELETE },
 	{ "undelete", EM_POPUP_SELECT_UNDELETE },
 	{ "mailing_list", EM_POPUP_SELECT_MAILING_LIST },
Index: em-popup.h
===================================================================
--- em-popup.h	(revision 34333)
+++ em-popup.h	(working copy)
@@ -105,7 +105,9 @@
 	EM_POPUP_SELECT_FOLDER             = 1<<15,     /* do we have any folder at all? */
 	EM_POPUP_SELECT_JUNK               = 1<<16,
 	EM_POPUP_SELECT_NOT_JUNK           = 1<<17,
-	EM_POPUP_SELECT_LAST               = 1<<18,	
+	EM_POPUP_SELECT_MARK_ARCHIVED      = 1<<18,	/* Archive a message */
+	EM_POPUP_SELECT_MARK_UNARCHIVED    = 1<<19,	/* Unarchive a message */
+	EM_POPUP_SELECT_LAST               = 1<<20,	
 };
 
 /**
Index: mail-component.c
===================================================================
--- mail-component.c	(revision 34333)
+++ mail-component.c	(working copy)
@@ -508,7 +508,7 @@
 
 	if (emfv->folder) {
 		char *name, *title;
-		guint32 visible, unread, deleted, junked;
+		guint32 visible, unread, deleted, junked, archived;
 		GPtrArray *selected;
 		GString *tmp = g_string_new("");
 
@@ -517,7 +517,8 @@
 				 CAMEL_FOLDER_DELETED, &deleted,
 				 CAMEL_FOLDER_VISIBLE, &visible,
 				 CAMEL_FOLDER_JUNKED, &junked,
-				 CAMEL_FOLDER_UNREAD, &unread, NULL);
+				 CAMEL_FOLDER_UNREAD, &unread, 
+				 CAMEL_FOLDER_ARCHIVED, &archived, NULL);
 
 		selected = message_list_get_selected(emfv->list);
 
@@ -528,7 +529,9 @@
 		if (CAMEL_IS_VTRASH_FOLDER(emfv->folder)) {
 			if (((CamelVTrashFolder *)emfv->folder)->type == CAMEL_VTRASH_FOLDER_TRASH) {
 				g_string_append_printf(tmp, ngettext ("%d deleted", "%d deleted", deleted), deleted);
-			} else {
+			}else if (((CamelVTrashFolder *)emfv->folder)->type == CAMEL_VTRASH_FOLDER_ARCHIVED) {
+				g_string_append_printf(tmp, ngettext ("%d archived", "%d archived", archived), archived);
+			}else {
 				g_string_append_printf(tmp, ngettext ("%d junk", "%d junk", junked), junked);
 			}
 		} else if (em_utils_folder_is_drafts(emfv->folder, emfv->folder_uri)) {
@@ -1301,6 +1304,11 @@
 		camel_exception_clear (&ex);
 		return NULL;
 	}
+	else if( strcmp(store->parent_object.provider->name, "IMAP")){
+		/* printf("||||||||||||||| REMOVING ARCHIVED FOLDER ON ||||||||||||||\n"); */
+		/* 		camel_object_bag_list (); */
+		/* store->folders, "Archived");  */
+	}
 
 	mail_component_add_store(component, store, name);
 	camel_object_unref (store);
Index: message-list.c
===================================================================
--- message-list.c	(revision 34333)
+++ message-list.c	(working copy)
@@ -234,6 +234,7 @@
 	{ "stock_score-highest",               NULL },
 	{ "stock_mail-flag-for-followup",      NULL },
 	{ "stock_mail-flag-for-followup-done", NULL },
+	{ "gtk-cdrom",                         NULL }, /* Archived */
 };
 
 /* FIXME: junk prefs */
@@ -1231,7 +1232,9 @@
 	switch (col){
 	case COL_MESSAGE_STATUS:
 		flags = camel_message_info_flags(msg_info);
-		if (flags & CAMEL_MESSAGE_ANSWERED)
+		if (flags & CAMEL_MESSAGE_ARCHIVED)
+			return GINT_TO_POINTER (5);
+		else if (flags & CAMEL_MESSAGE_ANSWERED)
 			return GINT_TO_POINTER (2);
 		else if (flags & CAMEL_MESSAGE_SEEN)
 			return GINT_TO_POINTER (1);
@@ -1351,6 +1354,9 @@
 					label = NULL;
 					goto find_colour;
 				}
+			} else if (camel_message_info_flags(msg_info) & CAMEL_MESSAGE_ARCHIVED) {
+				/* Archived message will be shown in DarkGreen Colour. */
+				colour = "DarkGreen";
 			} else if (camel_message_info_flags(msg_info) & CAMEL_MESSAGE_FLAGGED) {
 				/* FIXME: extract from the important.xpm somehow. */
 				colour = "#A7453E";
@@ -1639,8 +1645,9 @@
 	
 	for (i = 0; i < 5; i++)
 		images [i] = states_pixmaps [i].pixbuf;
+	images [i] = states_pixmaps [17].pixbuf;
 	
-	e_table_extras_add_cell (extras, "render_message_status", e_cell_toggle_new (0, 5, images));
+	e_table_extras_add_cell (extras, "render_message_status", e_cell_toggle_new (0, 6, images));
 	
 	for (i = 0; i < 2; i++)
 		images [i] = states_pixmaps [i + 5].pixbuf;
@@ -2406,9 +2413,11 @@
 {
 	gboolean is_junk_folder;
 	gboolean is_trash_folder;
+	gboolean is_archived_folder;
 	guint32 flags;
 	gboolean flag_junk;
 	gboolean flag_deleted;
+	gboolean flag_archived;
 
 	g_return_val_if_fail (ml != NULL, FALSE);
 	g_return_val_if_fail (ml->folder != NULL, FALSE);
@@ -2417,11 +2426,13 @@
 	/* check folder type */
 	is_junk_folder = ml->folder->folder_flags & CAMEL_FOLDER_IS_JUNK;
 	is_trash_folder = ml->folder->folder_flags & CAMEL_FOLDER_IS_TRASH;
+	is_archived_folder = ml->folder->folder_flags & CAMEL_FOLDER_IS_ARCHIVED;
 
 	/* check flags set on current message */
 	flags = camel_message_info_flags (info);
 	flag_junk = flags & CAMEL_MESSAGE_JUNK;
 	flag_deleted = flags & CAMEL_MESSAGE_DELETED;
+	flag_archived = flags & CAMEL_MESSAGE_ARCHIVED;
 
 	/* perform actions depending on folder type */	
 	if (is_junk_folder) {
@@ -2436,6 +2447,10 @@
 		 * not deleted any more */
 		if (flag_deleted)
 			return TRUE;
+	} else if (is_archived_folder) {
+		/* Lucky : Archived folder node is selectable */
+		if (flag_archived)
+			return TRUE;
 	} else {
 		/* in normal folders it depends on hidedeleted,
 		 * hidejunk and the message flags */
