aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-06-10 12:19:55 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-06-10 12:19:55 +0800
commit3be1418c8a85a8bb85ff3bb7b8fe50b34021899b (patch)
tree3cd11f3e9156a54df3fa16c81645a3db3ed2f2ba
parent7300480467a26360c6263afcb159a708d2dbca98 (diff)
downloadgsoc2013-evolution-3be1418c8a85a8bb85ff3bb7b8fe50b34021899b.tar
gsoc2013-evolution-3be1418c8a85a8bb85ff3bb7b8fe50b34021899b.tar.gz
gsoc2013-evolution-3be1418c8a85a8bb85ff3bb7b8fe50b34021899b.tar.bz2
gsoc2013-evolution-3be1418c8a85a8bb85ff3bb7b8fe50b34021899b.tar.lz
gsoc2013-evolution-3be1418c8a85a8bb85ff3bb7b8fe50b34021899b.tar.xz
gsoc2013-evolution-3be1418c8a85a8bb85ff3bb7b8fe50b34021899b.tar.zst
gsoc2013-evolution-3be1418c8a85a8bb85ff3bb7b8fe50b34021899b.zip
add some :filter debug. (open_folder): only ignore the get_folder
2004-06-10 Not Zed <NotZed@Ximian.com> * camel-filter-driver.c (camel_filter_driver_filter_message): add some :filter debug. (open_folder): only ignore the get_folder exception if we have a default folder, otherwise don't. See #59727. svn path=/trunk/; revision=26275
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/camel-filter-driver.c37
2 files changed, 34 insertions, 8 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 5487d5e9b0..1801d5f429 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,10 @@
2004-06-10 Not Zed <NotZed@Ximian.com>
+ * camel-filter-driver.c (camel_filter_driver_filter_message): add
+ some :filter debug.
+ (open_folder): only ignore the get_folder exception if we have a
+ default folder, otherwise don't. See #59727.
+
* providers/nntp/camel-nntp-store.c (camel_nntp_command): move the
stream based checking into the loop, after we connect. Fixes a
crash.
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
index 33eae9e843..c1e28c3383 100644
--- a/camel/camel-filter-driver.c
+++ b/camel/camel-filter-driver.c
@@ -45,6 +45,8 @@
#include "camel-stream-mem.h"
#include "camel-mime-message.h"
+#include "camel-debug.h"
+
#include "e-util/e-sexp.h"
#include "e-util/e-memory.h"
#include "e-util/e-msgport.h" /* for edlist */
@@ -894,16 +896,25 @@ open_folder (CamelFilterDriver *driver, const char *folder_url)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
CamelFolder *camelfolder;
- CamelException ex;
/* we have a lookup table of currently open folders */
camelfolder = g_hash_table_lookup (p->folders, folder_url);
if (camelfolder)
return camelfolder == FOLDER_INVALID?NULL:camelfolder;
-
- camel_exception_init (&ex);
- camelfolder = p->get_folder (driver, folder_url, p->data, &ex);
- camel_exception_clear (&ex);
+
+ /* if we have a default folder, ignore exceptions. This is so
+ a bad filter rule on pop or local delivery doesn't result
+ in duplicate mails, just mail going to inbox. Otherwise,
+ we want to know about exceptions and abort processing */
+ if (p->defaultfolder) {
+ CamelException ex;
+
+ camel_exception_init (&ex);
+ camelfolder = p->get_folder (driver, folder_url, p->data, &ex);
+ camel_exception_clear (&ex);
+ } else {
+ camelfolder = p->get_folder (driver, folder_url, p->data, p->ex);
+ }
if (camelfolder) {
g_hash_table_insert (p->folders, g_strdup (folder_url), camelfolder);
@@ -1383,7 +1394,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
while (node->next && !p->terminated) {
struct _get_message data;
- d(fprintf (stderr, "applying rule %s\naction %s\n", node->match, node->action));
+ d(printf("applying rule %s\naction %s\n", node->match, node->action));
data.p = p;
data.source_url = original_source_url;
@@ -1398,7 +1409,11 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
case CAMEL_SEARCH_MATCHED:
filtered = TRUE;
camel_filter_driver_log (driver, FILTER_LOG_START, node->name);
-
+
+ if (camel_debug(":filter"))
+ printf("filtering '%s' applying rule %s\n",
+ camel_message_info_subject(info)?camel_message_info_subject(info):"?no subject?", node->name);
+
/* perform necessary filtering actions */
e_sexp_input_text (p->eval, node->action, strlen (node->action));
if (e_sexp_parse (p->eval) == -1) {
@@ -1433,6 +1448,12 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
/* copy it to the default inbox */
filtered = TRUE;
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Copy to default folder");
+
+ if (camel_debug(":filter"))
+ printf("filtering '%s' copy %s to default folder\n",
+ camel_message_info_subject(info)?camel_message_info_subject(info):"?no subject?",
+ p->modified?"modified message":"");
+
if (!p->modified && p->uid && p->source && camel_folder_has_summary_capability (p->source)) {
GPtrArray *uids;
@@ -1446,7 +1467,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
if (!p->message)
goto error;
}
-
+
camel_folder_append_message (p->defaultfolder, p->message, p->info, NULL, p->ex);
}
}