From 4677f26be4d870ff66a9a80e92742bc72fe68042 Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Fri, 8 Jun 2001 16:38:05 +0000 Subject: If you had multiple accounts that used mboxes, and if you received mail in 2001-06-08 Jon Trowbridge * 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 --- mail/ChangeLog | 10 ++++++++++ mail/mail-tools.c | 13 ++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index e12cca3bfd..1cbeefbd50 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,13 @@ +2001-06-08 Jon Trowbridge + + * 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. + 2001-06-07 Jon Trowbridge * mail-ops.c (fetch_mail_fetch): Pass the original source URI 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 #endif +#include #include #include #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 * -- cgit v1.2.3