diff --git a/camel/camel-exchange-folder.c b/camel/camel-exchange-folder.c
index 359990c..54b8c1c 100644
--- a/camel/camel-exchange-folder.c
+++ b/camel/camel-exchange-folder.c
@@ -77,6 +77,10 @@ static void            transfer_messages_to  (CamelFolder *source,
 					      GPtrArray **transferred_uids,
 					      gboolean delete_originals,
 					      CamelException *ex);
+static void   expunge_uids (CamelFolder *source,
+			    GPtrArray *uids,
+			    CamelException *ex);
+
 static void   transfer_messages_the_hard_way (CamelFolder *source,
 					      GPtrArray *uids,
 					      CamelFolder *dest,
@@ -105,6 +109,7 @@ class_init (CamelFolderClass *camel_folder_class)
 	/* use the default function for the search_free */
 	/* camel_folder_class->search_free = search_free; */
 	camel_folder_class->transfer_messages_to = transfer_messages_to;
+	camel_folder_class->expunge_uids = expunge_uids;
 	camel_folder_class->refresh_info = refresh_info;
 	camel_folder_class->sync = exchange_sync;
 	camel_folder_class->get_filename = get_filename;
@@ -620,6 +625,18 @@ cache_xfer (CamelExchangeFolder *stub_source, CamelExchangeFolder *stub_dest,
 }
 
 static void
+expunge_uids (CamelFolder *source, GPtrArray *uids,
+		CamelException *ex)
+{
+	CamelExchangeFolder *exch_source = CAMEL_EXCHANGE_FOLDER (source);
+
+	camel_stub_send (exch_source->stub, ex, CAMEL_STUB_CMD_EXPUNGE_UIDS,
+			 CAMEL_STUB_ARG_FOLDER, source->full_name,
+			 CAMEL_STUB_ARG_STRINGARRAY, uids,
+			 CAMEL_STUB_ARG_END);
+}
+
+static void
 transfer_messages_to (CamelFolder *source, GPtrArray *uids,
 		      CamelFolder *dest, GPtrArray **transferred_uids,
 		      gboolean delete_originals, CamelException *ex)
@@ -1110,6 +1127,8 @@ camel_exchange_folder_construct (CamelFolder *folder, CamelStore *parent,
 
 		if (folder_flags & CAMEL_STUB_FOLDER_FILTER)
 			folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
+		if (folder_flags & CAMEL_STUB_FOLDER_FILTER_EXPUNGE)
+			folder->folder_flags |= CAMEL_FOLDER_FILTER_EXPUNGE;	
 		if (folder_flags & CAMEL_STUB_FOLDER_FILTER_JUNK)
 			folder->folder_flags |= CAMEL_FOLDER_FILTER_JUNK;
 
diff --git a/camel/camel-exchange-provider.c b/camel/camel-exchange-provider.c
index 2b3f6e0..354fe98 100644
--- a/camel/camel-exchange-provider.c
+++ b/camel/camel-exchange-provider.c
@@ -96,6 +96,8 @@ CamelProviderConfEntry exchange_conf_entries[] = {
 	{ CAMEL_PROVIDER_CONF_CHECKBOX, "filter", NULL,
 	  /* i18n: copy from evolution:camel-imap-provider.c */
 	  N_("_Apply filters to new messages in Inbox on this server"), "0" },
+	{ CAMEL_PROVIDER_CONF_CHECKBOX, "filter_expunge", "filter",
+	  N_("_Expunge mails after filtering messages"), "0" },
 	{ CAMEL_PROVIDER_CONF_CHECKBOX, "filter_junk", NULL,
 	  N_("Check new messages for _Junk contents"), "0" },
 	{ CAMEL_PROVIDER_CONF_CHECKBOX, "filter_junk_inbox", "filter_junk",
diff --git a/camel/camel-stub-constants.h b/camel/camel-stub-constants.h
index 25db758..3377538 100644
--- a/camel/camel-stub-constants.h
+++ b/camel/camel-stub-constants.h
@@ -69,17 +69,18 @@ typedef enum {
 } CamelStubRetval;
 
 typedef enum {
-	CAMEL_STUB_FOLDER_READONLY    = (1<<0),
-	CAMEL_STUB_FOLDER_FILTER      = (1<<1),
-	CAMEL_STUB_FOLDER_POST        = (1<<2),
-	CAMEL_STUB_FOLDER_NOSELECT    = (1<<4),
-	CAMEL_STUB_FOLDER_FILTER_JUNK = (1<<5),
-	CAMEL_STUB_FOLDER_SYSTEM      = (1<<6),
-	CAMEL_STUB_FOLDER_TYPE_INBOX  = (1<<7),
-	CAMEL_STUB_FOLDER_SUBSCRIBED  = (1<<8),
-	CAMEL_STUB_FOLDER_NOCHILDREN  = (1<<9),
-	CAMEL_STUB_FOLDER_TYPE_TRASH  = (1<<10),
-	CAMEL_STUB_FOLDER_TYPE_SENT   = (1<<11)
+	CAMEL_STUB_FOLDER_READONLY       = (1<<0),
+	CAMEL_STUB_FOLDER_FILTER         = (1<<1),
+	CAMEL_STUB_FOLDER_POST           = (1<<2),
+	CAMEL_STUB_FOLDER_FILTER_EXPUNGE = (1<<3),
+	CAMEL_STUB_FOLDER_NOSELECT       = (1<<4),
+	CAMEL_STUB_FOLDER_FILTER_JUNK    = (1<<5),
+	CAMEL_STUB_FOLDER_SYSTEM         = (1<<6),
+	CAMEL_STUB_FOLDER_TYPE_INBOX     = (1<<7),
+	CAMEL_STUB_FOLDER_SUBSCRIBED     = (1<<8),
+	CAMEL_STUB_FOLDER_NOCHILDREN     = (1<<9),
+	CAMEL_STUB_FOLDER_TYPE_TRASH     = (1<<10),
+	CAMEL_STUB_FOLDER_TYPE_SENT      = (1<<11),
 } CamelStubFolderFlags;
 
 typedef enum {
diff --git a/mail/mail-stub-exchange.c b/mail/mail-stub-exchange.c
index 6a5906a..1a5c178 100644
--- a/mail/mail-stub-exchange.c
+++ b/mail/mail-stub-exchange.c
@@ -1036,8 +1036,11 @@ get_folder (MailStub *stub, const gchar *name, gboolean create,
 	camel_flags = 0;
 	if ((mfld->access & (MAPI_ACCESS_MODIFY | MAPI_ACCESS_CREATE_CONTENTS)) == 0)
 		camel_flags |= CAMEL_STUB_FOLDER_READONLY;
-	if (mse->account->filter_inbox && (mfld->folder == mse->inbox))
+	if (mse->account->filter_inbox && (mfld->folder == mse->inbox)) {
 		camel_flags |= CAMEL_STUB_FOLDER_FILTER;
+		if (mse->account->filter_inbox_expunge)
+			camel_flags |= CAMEL_STUB_FOLDER_FILTER_EXPUNGE;
+	}
 	if (mse->account->filter_junk) {
 		if ((mfld->folder != mse->deleted_items) &&
 		    ((mfld->folder == mse->inbox) ||
