aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-utils.c')
-rw-r--r--mail/em-utils.c24
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;
+}