aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-tools.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-06-09 00:38:05 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-06-09 00:38:05 +0800
commit4677f26be4d870ff66a9a80e92742bc72fe68042 (patch)
tree3a4f33f1d9f880b6c7197c82b017283480ea0836 /mail/mail-tools.c
parentfa00be05bf00e1c1197724f754ce4aca5a334342 (diff)
downloadgsoc2013-evolution-4677f26be4d870ff66a9a80e92742bc72fe68042.tar
gsoc2013-evolution-4677f26be4d870ff66a9a80e92742bc72fe68042.tar.gz
gsoc2013-evolution-4677f26be4d870ff66a9a80e92742bc72fe68042.tar.bz2
gsoc2013-evolution-4677f26be4d870ff66a9a80e92742bc72fe68042.tar.lz
gsoc2013-evolution-4677f26be4d870ff66a9a80e92742bc72fe68042.tar.xz
gsoc2013-evolution-4677f26be4d870ff66a9a80e92742bc72fe68042.tar.zst
gsoc2013-evolution-4677f26be4d870ff66a9a80e92742bc72fe68042.zip
If you had multiple accounts that used mboxes, and if you received mail in
2001-06-08 Jon Trowbridge <trow@ximian.com> * mail-tools.c (mail_tool_get_local_movemail_path): If you had multiple accounts that used mboxes, and if you received mail in N of those accounts, you would get N copies of each of your e-mail messages. This is because everything was being dumped into one big file by movemail, and the filters would run on that file N times. To work around this, each mbox account now gets its own distinct temporary movemail file. svn path=/trunk/; revision=10155
Diffstat (limited to 'mail/mail-tools.c')
-rw-r--r--mail/mail-tools.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index abec85f86c..d5966a8993 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -29,6 +29,7 @@
#include <config.h>
#endif
+#include <pthread.h>
#include <ctype.h>
#include <errno.h>
#include "camel/camel.h"
@@ -88,7 +89,17 @@ mail_tool_get_folder_name (CamelFolder *folder)
gchar *
mail_tool_get_local_movemail_path (void)
{
- return g_strdup_printf ("%s/local/Inbox/movemail", evolution_dir);
+ static gint count = 0;
+ static pthread_mutex_t movemail_path_lock = PTHREAD_MUTEX_INITIALIZER;
+ gint my_count;
+
+ /* Ah, the joys of being multi-threaded... */
+ pthread_mutex_lock (&movemail_path_lock);
+ my_count = count;
+ ++count;
+ pthread_mutex_unlock (&movemail_path_lock);
+
+ return g_strdup_printf ("%s/local/Inbox/movemail.%d", evolution_dir, my_count);
}
CamelFolder *