diff options
author | Milan Crha <mcrha@redhat.com> | 2011-03-03 21:11:41 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-03-03 21:13:33 +0800 |
commit | f1e416438026e495a29ca36715e27964f7dc4b04 (patch) | |
tree | 6c85cc847fc857634870bc5dd644a3be342f2c3a /mail/em-utils.c | |
parent | 0be641ea82d61a5967d4f34dde9bc3bbbb9aa7cf (diff) | |
download | gsoc2013-evolution-f1e416438026e495a29ca36715e27964f7dc4b04.tar.gz gsoc2013-evolution-f1e416438026e495a29ca36715e27964f7dc4b04.tar.zst gsoc2013-evolution-f1e416438026e495a29ca36715e27964f7dc4b04.zip |
Bug #643218 - Local delivery doesn't deliver after maildir migration
Diffstat (limited to 'mail/em-utils.c')
-rw-r--r-- | mail/em-utils.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mail/em-utils.c b/mail/em-utils.c index 2fdee28270..09692f0b1b 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -2353,3 +2353,27 @@ emu_restore_folder_tree_state (EMFolderTree *folder_tree) g_key_file_free (key_file); } + +/* checks whether uri points to a local mbox file and returns TRUE if yes. */ +gboolean +em_utils_is_local_delivery_mbox_file (const gchar *uri) +{ + g_return_val_if_fail (uri != NULL, FALSE); + + if (g_str_has_prefix (uri, "mbox:///")) { + CamelURL *curl; + + curl = camel_url_new (uri, NULL); + if (curl) { + if (curl->path + && g_file_test (curl->path, G_FILE_TEST_EXISTS) + && !g_file_test (curl->path, G_FILE_TEST_IS_DIR)) { + camel_url_free (curl); + return TRUE; + } + camel_url_free (curl); + } + } + + return FALSE; +} |