diff options
author | Milan Crha <mcrha@redhat.com> | 2011-05-05 19:22:46 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-05-05 19:22:46 +0800 |
commit | 19a9f3474019e83d51f2baee6537f5c71a208a2a (patch) | |
tree | 28574fb399e4691ac420546afad08f764fe7174f | |
parent | 3382355fb8c1ba535d8cc67701fdf17e1ea3ff3b (diff) | |
download | gsoc2013-evolution-19a9f3474019e83d51f2baee6537f5c71a208a2a.tar gsoc2013-evolution-19a9f3474019e83d51f2baee6537f5c71a208a2a.tar.gz gsoc2013-evolution-19a9f3474019e83d51f2baee6537f5c71a208a2a.tar.bz2 gsoc2013-evolution-19a9f3474019e83d51f2baee6537f5c71a208a2a.tar.lz gsoc2013-evolution-19a9f3474019e83d51f2baee6537f5c71a208a2a.tar.xz gsoc2013-evolution-19a9f3474019e83d51f2baee6537f5c71a208a2a.tar.zst gsoc2013-evolution-19a9f3474019e83d51f2baee6537f5c71a208a2a.zip |
Bug #627952 - 'Local delivery' mbox's aren't read properly
-rw-r--r-- | mail/e-mail-store.c | 20 | ||||
-rw-r--r-- | mail/em-utils.c | 2 |
2 files changed, 15 insertions, 7 deletions
diff --git a/mail/e-mail-store.c b/mail/e-mail-store.c index 65bcbc822b..6313640f93 100644 --- a/mail/e-mail-store.c +++ b/mail/e-mail-store.c @@ -248,17 +248,24 @@ mail_store_load_accounts (EMailSession *session, if (!account->enabled) continue; - /* Do not add local-delivery files. */ + /* Do not add local-delivery files, but make them ready for later use. */ url = camel_url_new (account->source->url, NULL); if (url != NULL) { skip = em_utils_is_local_delivery_mbox_file (url); camel_url_free (url); } - if (skip) - continue; + if (skip) { + GError *error = NULL; - e_mail_store_add_by_account (session, account); + if (!camel_session_add_service (CAMEL_SESSION (session), account->uid, account->source->url, CAMEL_PROVIDER_STORE, &error)) { + g_warning ("%s: Failed to add '%s' as store: %s", G_STRFUNC, account->source->url, error ? error->message : "Unknown error"); + if (error) + g_error_free (error); + } + } else { + e_mail_store_add_by_account (session, account); + } /* While we're at it, add the account's transport to the * CamelSession. The transport's UID is a kludge for now. @@ -359,8 +366,9 @@ fail: /* FIXME: Show an error dialog. */ g_warning ( "Couldn't get service: %s: %s", account->name, - error->message); - g_error_free (error); + error ? error->message : "Not a CamelStore"); + if (error) + g_error_free (error); return NULL; } diff --git a/mail/em-utils.c b/mail/em-utils.c index 9b21fda7ad..c20649c782 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -2443,7 +2443,7 @@ em_utils_is_local_delivery_mbox_file (CamelURL *url) { g_return_val_if_fail (url != NULL, FALSE); - return g_str_has_prefix (url->protocol, "mbox:") && + return g_str_equal (url->protocol, "mbox") && (url->path != NULL) && g_file_test (url->path, G_FILE_TEST_EXISTS) && !g_file_test (url->path, G_FILE_TEST_IS_DIR); |