aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/local
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-01-10 05:34:07 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-01-10 05:34:07 +0800
commit623a8d83ce693c5250d85e81c674f899234ce70d (patch)
treee89d79c525d04dde5d30deb2a0239ab18b0c125c /camel/providers/local
parentec0820a46f72c19ac8ada64edc7ac1c4ecad90a0 (diff)
downloadgsoc2013-evolution-623a8d83ce693c5250d85e81c674f899234ce70d.tar
gsoc2013-evolution-623a8d83ce693c5250d85e81c674f899234ce70d.tar.gz
gsoc2013-evolution-623a8d83ce693c5250d85e81c674f899234ce70d.tar.bz2
gsoc2013-evolution-623a8d83ce693c5250d85e81c674f899234ce70d.tar.lz
gsoc2013-evolution-623a8d83ce693c5250d85e81c674f899234ce70d.tar.xz
gsoc2013-evolution-623a8d83ce693c5250d85e81c674f899234ce70d.tar.zst
gsoc2013-evolution-623a8d83ce693c5250d85e81c674f899234ce70d.zip
If the mbox file is a symlink, follow the symlink and get the One True
2002-01-09 Jeffrey Stedfast <fejj@ximian.com> * providers/local/camel-mbox-folder.c (camel_mbox_folder_new): If the mbox file is a symlink, follow the symlink and get the One True Path so that we can rewrite the mbox later without worrying about clobbering the symlink. 2002-01-08 Jeffrey Stedfast <fejj@ximian.com> * camel-filter-search.c (TODO): There are a few sexp callbacks that could be modified to use fms->info rather than using a message object (like date and possibly mlist stuff) but *only* if the date exists on the CamelMessageInfo object (since it may be blank except for message flags). (camel_filter_search_get_message): New internal convenience function to make sure that the FilterMessageSearch has loaded the message (and to load the message if this isn't the case). (check_header): Call camel_filter_search_get_message(). (header_exists): Same. (header_regex): Here too. (header_full_regex): And here. (body_contains): Again here. (body_regex): Here too. (get_sent_date): Here also. (get_received_date): Same. (get_source): Here if we need to. (camel_filter_search_match): Now takes a callback function/data pair for on-demand message loading so that we don't necessarily have to load the message if the defined filter rules don't require it. * camel-filter-driver.c (camel_filter_driver_filter_folder): Don't bother fetching the message here, let camel_filter_driver_filter_message() worry about this. (get_message_cb): New utility callback to fetch a message. (camel_filter_driver_filter_message): Only fetch the message if we absolutely need it to get a CamelMessageInfo. Instead of passing a message object to camel_filter_search_match(), pass get_message_cb and some user_data so that the matching code can fetch the message on demand. svn path=/trunk/; revision=15276
Diffstat (limited to 'camel/providers/local')
-rw-r--r--camel/providers/local/camel-local-folder.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
index 0a4d581bdf..b6d6ef8ab2 100644
--- a/camel/providers/local/camel-local-folder.c
+++ b/camel/providers/local/camel-local-folder.c
@@ -24,6 +24,7 @@
#endif
#include <stdlib.h>
+#include <limits.h>
#include <sys/types.h>
#include <dirent.h>
#include <sys/stat.h>
@@ -172,6 +173,7 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con
CamelFolderInfo *fi;
CamelFolder *folder;
const char *root_dir_path, *name;
+ char folder_path[PATH_MAX];
struct stat st;
int forceindex;
@@ -191,13 +193,19 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con
lf->folder_path = g_strdup_printf("%s/%s", root_dir_path, full_name);
lf->summary_path = g_strdup_printf("%s/%s.ev-summary", root_dir_path, full_name);
lf->index_path = g_strdup_printf("%s/%s.ibex", root_dir_path, full_name);
-
+
+ /* follow any symlinks to the mailbox */
+ if (lstat (lf->folder_path, &st) != -1 && S_ISLNK (st.st_mode) &&
+ realpath (lf->folder_path, folder_path) != NULL) {
+ g_free (lf->folder_path);
+ lf->folder_path = g_strdup (folder_path);
+ }
+
lf->changes = camel_folder_change_info_new();
/* if we have no index file, force it */
forceindex = stat(lf->index_path, &st) == -1;
if (flags & CAMEL_STORE_FOLDER_BODY_INDEX) {
-
lf->index = ibex_open(lf->index_path, O_CREAT | O_RDWR, 0600);
if (lf->index == NULL) {
/* yes, this isn't fatal at all */