aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-06-02 05:13:57 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:42:22 +0800
commitde29fdc57258c162f37d0862469362f859e32c47 (patch)
treeae981042a33b118bc9e6453c117dcd56170e4edf
parentdc65d0dfeb1436daf42c6a4664ee35e5cfbe68f3 (diff)
downloadgsoc2013-evolution-de29fdc57258c162f37d0862469362f859e32c47.tar.gz
gsoc2013-evolution-de29fdc57258c162f37d0862469362f859e32c47.tar.zst
gsoc2013-evolution-de29fdc57258c162f37d0862469362f859e32c47.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