Index: camel/providers/imap/camel-imap-store.c
===================================================================
--- camel/providers/imap/camel-imap-store.c	(revision 9075)
+++ camel/providers/imap/camel-imap-store.c	(working copy)
@@ -286,6 +286,8 @@ construct (CamelService *service, CamelS
 	}
 	if (camel_url_get_param (url, "check_all"))
 		imap_store->parameters |= IMAP_PARAM_CHECK_ALL;
+	if (camel_url_get_param (url, "check_lsub"))
+		imap_store->parameters |= IMAP_PARAM_CHECK_LSUB;
 	if (camel_url_get_param (url, "filter")) {
 		imap_store->parameters |= IMAP_PARAM_FILTER_INBOX;
 		store->flags |= CAMEL_STORE_FILTER_INBOX;
@@ -377,6 +379,10 @@ imap_setv (CamelObject *object, CamelExc
 			store->parameters = flags;
 			/* no need to reconnect for this option to take effect... */
 			break;
+		case CAMEL_IMAP_STORE_CHECK_LSUB:
+			flags = args->argv[i].ca_int ? IMAP_PARAM_CHECK_LSUB : 0;
+			store->parameters = flags | (store->parameters & ~IMAP_PARAM_CHECK_LSUB);
+			break;
 		case CAMEL_IMAP_STORE_FILTER_INBOX:
 			flags = args->argv[i].ca_int ? IMAP_PARAM_FILTER_INBOX : 0;
 			flags |= (store->parameters & ~IMAP_PARAM_FILTER_INBOX);
@@ -432,6 +438,9 @@ imap_getv (CamelObject *object, CamelExc
 		case CAMEL_IMAP_STORE_CHECK_ALL:
 			*args->argv[i].ca_int = store->parameters & IMAP_PARAM_CHECK_ALL ? TRUE : FALSE;
 			break;
+		case CAMEL_IMAP_STORE_CHECK_LSUB:
+			*args->argv[i].ca_int = store->parameters & IMAP_PARAM_CHECK_LSUB ? TRUE : FALSE;
+			break;
 		case CAMEL_IMAP_STORE_FILTER_INBOX:
 			*args->argv[i].ca_int = store->parameters & IMAP_PARAM_FILTER_INBOX ? TRUE : FALSE;
 			break;
@@ -3116,7 +3125,8 @@ imap_can_refresh_folder (CamelStore *sto
 	gboolean res;
 
 	res = CAMEL_STORE_CLASS(parent_class)->can_refresh_folder (store, info, ex) ||
-	      (camel_url_get_param (((CamelService *)store)->url, "check_all") != NULL);
+	      (camel_url_get_param (((CamelService *)store)->url, "check_all") != NULL) ||
+	      (camel_url_get_param (((CamelService *)store)->url, "check_lsub") != NULL && (info->flags & CAMEL_FOLDER_SUBSCRIBED) != 0);
 
 	if (!res && !camel_exception_is_set (ex)) {
 		CamelFolder *folder;
Index: camel/providers/imap/camel-imap-store.h
===================================================================
--- camel/providers/imap/camel-imap-store.h	(revision 9075)
+++ camel/providers/imap/camel-imap-store.h	(working copy)
@@ -66,7 +66,8 @@ enum {
 	CAMEL_IMAP_STORE_ARG_CHECK_ALL,
 	CAMEL_IMAP_STORE_ARG_FILTER_INBOX,
 	CAMEL_IMAP_STORE_ARG_FILTER_JUNK,
-	CAMEL_IMAP_STORE_ARG_FILTER_JUNK_INBOX
+	CAMEL_IMAP_STORE_ARG_FILTER_JUNK_INBOX,
+	CAMEL_IMAP_STORE_ARG_CHECK_LSUB
 };
 
 #define CAMEL_IMAP_STORE_NAMESPACE           (CAMEL_IMAP_STORE_ARG_NAMESPACE | CAMEL_ARG_STR)
@@ -75,6 +76,7 @@ enum {
 #define CAMEL_IMAP_STORE_FILTER_INBOX        (CAMEL_IMAP_STORE_ARG_FILTER_INBOX | CAMEL_ARG_INT)
 #define CAMEL_IMAP_STORE_FILTER_JUNK         (CAMEL_IMAP_STORE_ARG_FILTER_JUNK | CAMEL_ARG_BOO)
 #define CAMEL_IMAP_STORE_FILTER_JUNK_INBOX   (CAMEL_IMAP_STORE_ARG_FILTER_JUNK_INBOX | CAMEL_ARG_BOO)
+#define CAMEL_IMAP_STORE_CHECK_LSUB          (CAMEL_IMAP_STORE_ARG_CHECK_LSUB | CAMEL_ARG_BOO)
 
 /* CamelFolderInfo flags */
 #define CAMEL_IMAP_FOLDER_MARKED	     (1<<16)
@@ -106,6 +108,7 @@ typedef enum {
 #define IMAP_PARAM_FILTER_JUNK			(1 << 3)
 #define IMAP_PARAM_FILTER_JUNK_INBOX		(1 << 4)
 #define IMAP_PARAM_SUBSCRIPTIONS		(1 << 5)
+#define IMAP_PARAM_CHECK_LSUB			(1 << 6) /* check for new messages in subscribed folders */
 
 #define IMAP_FETCH_ALL_HEADERS 1
 #define IMAP_FETCH_MAILING_LIST_HEADERS 2 /* Fetches Minimal and Mailing List Headers. Default behavior */
Index: camel/providers/imap/ChangeLog
===================================================================
--- camel/providers/imap/ChangeLog	(revision 9075)
+++ camel/providers/imap/ChangeLog	(working copy)
@@ -1,3 +1,13 @@
+2008-07-01  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #336074
+
+	* camel-imap-provider.c: (imap_conf_entries):
+	* camel-imap-store.h:
+	* camel-imap-store.c: (construct), (imap_setv), (imap_getv),
+	(imap_can_refresh_folder): New option "check_lsub", when set,
+	then checking for new messages in subscribed folders.
+
 2008-06-30  Milan Crha  <mcrha@redhat.com>
 
 	** Fix for bug #330838
Index: camel/providers/imap/camel-imap-provider.c
===================================================================
--- camel/providers/imap/camel-imap-provider.c	(revision 9075)
+++ camel/providers/imap/camel-imap-provider.c	(working copy)
@@ -44,6 +44,8 @@ CamelProviderConfEntry imap_conf_entries
 	  N_("Checking for New Mail") },
 	{ CAMEL_PROVIDER_CONF_CHECKBOX, "check_all", NULL,
 	  N_("C_heck for new messages in all folders"), "1" },
+	{ CAMEL_PROVIDER_CONF_CHECKBOX, "check_lsub", NULL,
+	  N_("Ch_eck for new messages in subscribed folders"), "0" },
 	{ CAMEL_PROVIDER_CONF_SECTION_END },
 #ifndef G_OS_WIN32
 	{ CAMEL_PROVIDER_CONF_SECTION_START, "cmdsection", NULL,
