aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-06-02 05:13:57 +0800
committerMilan Crha <mcrha@redhat.com>2011-06-02 05:15:55 +0800
commit3053c319827b02d8f6079f68a64b9a018ce41fe5 (patch)
tree8e97deb085ee1d2088c0a87b0f1f6840a30f37e2
parent5397fae770dfafc7d7180e4922a84dac249bf91d (diff)
downloadgsoc2013-evolution-3053c319827b02d8f6079f68a64b9a018ce41fe5.tar.gz
gsoc2013-evolution-3053c319827b02d8f6079f68a64b9a018ce41fe5.tar.zst
gsoc2013-evolution-3053c319827b02d8f6079f68a64b9a018ce41fe5.zip
Bug #649757 - 'Local delivery' accounts stopped working
-rw-r--r--mail/mail-ops.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index e52996c36e..85805ffa5c 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -211,7 +211,8 @@ fetch_mail_exec (struct _fetch_mail_msg *m,
GError **error)
{
struct _filter_mail_msg *fm = (struct _filter_mail_msg *) m;
- CamelFolder *folder;
+ CamelFolder *folder = NULL;
+ CamelURL *url;
const gchar *uid;
gint i;
@@ -221,11 +222,36 @@ fetch_mail_exec (struct _fetch_mail_msg *m,
goto fail;
g_object_ref (fm->destination);
- uid = camel_service_get_uid (CAMEL_SERVICE (m->store));
+ url = camel_service_get_camel_url (CAMEL_SERVICE (m->store));
+ if (em_utils_is_local_delivery_mbox_file (url)) {
+ gchar *path;
+ gchar *url_string;
+
+ path = mail_tool_do_movemail (m->store, error);
+ url_string = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
- folder = fm->source_folder =
- e_mail_session_get_inbox_sync (
- fm->session, uid, cancellable, error);
+ if (path && (!error || !*error)) {
+ camel_folder_freeze (fm->destination);
+ camel_filter_driver_set_default_folder (
+ fm->driver, fm->destination);
+ camel_filter_driver_filter_mbox (
+ fm->driver, path, url_string,
+ cancellable, error);
+ camel_folder_thaw (fm->destination);
+
+ if (!error || !*error)
+ g_unlink (path);
+ }
+
+ g_free (path);
+ g_free (url_string);
+ } else {
+ uid = camel_service_get_uid (CAMEL_SERVICE (m->store));
+
+ folder = fm->source_folder =
+ e_mail_session_get_inbox_sync (
+ fm->session, uid, cancellable, error);
+ }
if (folder != NULL) {
/* This handles 'keep on server' stuff, if we have any new