summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-01-23 19:09:57 +0000
committerJeffrey Stedfast <fejj@src.gnome.org>2002-01-23 19:09:57 +0000
commitf52235e0230eac4bd3e46724e6d3779e06902fdd (patch)
tree2ca799d401eda4305ef58740d62882897e457273
parentc36722172c428cf2017ad1ec84e38e22a8460286 (diff)
downloadevolution-data-server-f52235e0230eac4bd3e46724e6d3779e06902fdd.tar.gz
Kludge around a bug in Exchange 5.5 that reports 2 messages with the sameEVOLUTION_1_0_2
2002-01-11 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-folder.c (imap_update_summary): Kludge around a bug in Exchange 5.5 that reports 2 messages with the same UID. Fixes bug #17694. 2002-01-09 Jeffrey Stedfast <fejj@ximian.com> * providers/local/camel-local-folder.c (camel_local_folder_construct): 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. 2001-12-11 Jeffrey Stedfast <fejj@ximian.com> * camel-service.c (camel_service_connect): Make sure that the connect_op is non-NULL before unregistering/unreffing it.
-rw-r--r--camel/ChangeLog19
-rw-r--r--camel/camel-service.c8
-rw-r--r--camel/providers/imap/camel-imap-command.c2
-rw-r--r--camel/providers/imap/camel-imap-folder.c29
-rw-r--r--camel/providers/local/camel-local-folder.c19
5 files changed, 70 insertions, 7 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 1436f12a6..37d4aba87 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,22 @@
+2002-01-11 Jeffrey Stedfast <fejj@ximian.com>
+
+ * providers/imap/camel-imap-folder.c (imap_update_summary): Kludge
+ around a bug in Exchange 5.5 that reports 2 messages with the same
+ UID. Fixes bug #17694.
+
+2002-01-09 Jeffrey Stedfast <fejj@ximian.com>
+
+ * providers/local/camel-local-folder.c
+ (camel_local_folder_construct): 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.
+
+2001-12-11 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-service.c (camel_service_connect): Make sure that the
+ connect_op is non-NULL before unregistering/unreffing it.
+
2001-12-12 Jeffrey Stedfast <fejj@ximian.com>
* camel-folder-summary.c (content_info_load): Don't try setting a
diff --git a/camel/camel-service.c b/camel/camel-service.c
index 9c32256fe..a166fcc55 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -260,12 +260,12 @@ camel_service_connect (CamelService *service, CamelException *ex)
service->status = ret ? CAMEL_SERVICE_CONNECTED : CAMEL_SERVICE_DISCONNECTED;
CAMEL_SERVICE_LOCK (service, connect_op_lock);
- if (service->connect_op) {
- if (unreg)
- camel_operation_unregister (service->connect_op);
-
+ if (unreg) {
+ camel_operation_unregister (service->connect_op);
camel_operation_unref (service->connect_op);
service->connect_op = NULL;
+ } else {
+ camel_operation_unref (service->connect_op);
}
CAMEL_SERVICE_UNLOCK (service, connect_op_lock);
diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c
index 5639741a4..f6fb0dde8 100644
--- a/camel/providers/imap/camel-imap-command.c
+++ b/camel/providers/imap/camel-imap-command.c
@@ -693,7 +693,7 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
len += arglen * 2;
start = p + 1;
break;
-
+
case '%':
start = p;
break;
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index e32d1696d..45dad9f6b 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -1849,8 +1849,35 @@ imap_update_summary (CamelFolder *folder, int exists,
g_datalist_clear (&data);
continue;
}
+
mi = messages->pdata[seq - first];
-
+ if (mi == NULL) {
+ CamelMessageInfo *pmi = NULL;
+ int j;
+
+ /* This is a kludge around a bug in Exchange
+ * 5.5 that sometimes claims multiple messages
+ * have the same UID. See bug #17694 for
+ * details. The "solution" is to create a fake
+ * message-info with the same details as the
+ * previously valid message. Yes, the user
+ * will have a clone in his/her message-list,
+ * but at least we don't crash.
+ */
+
+ /* find the previous valid message info */
+ for (j = seq - first - 1; j >= 0; j--) {
+ pmi = messages->pdata[j];
+ if (pmi != NULL)
+ break;
+ }
+
+ g_assert (pmi);
+
+ mi = camel_message_info_new ();
+ camel_message_info_dup_to (pmi, mi);
+ }
+
uid = g_datalist_get_data (&data, "UID");
if (uid)
camel_message_info_set_uid (mi, g_strdup (uid));
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
index 0a4d581bd..caf79d90f 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>
@@ -32,6 +33,10 @@
#include <string.h>
#include <fcntl.h>
+#ifndef _POSIX_PATH_MAX
+#include <posix1_lim.h>
+#endif
+
#include "camel-local-folder.h"
#include "camel-local-store.h"
#include "string-utils.h"
@@ -47,6 +52,10 @@
#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
+#ifndef PATH_MAX
+#define PATH_MAX _POSIX_PATH_MAX
+#endif
+
static CamelFolderClass *parent_class = NULL;
/* Returns the class for a CamelLocalFolder */
@@ -172,6 +181,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,7 +201,14 @@ 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 */