aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-filter-search.c
diff options
context:
space:
mode:
authorRadek Doulik <rodo@src.gnome.org>2003-11-13 05:13:05 +0800
committerRadek Doulik <rodo@src.gnome.org>2003-11-13 05:13:05 +0800
commit8e1251fa17b522d0539a8fcfb7463ba8cef1b31a (patch)
tree9be2f3a8a184446361a8c72879947f7a6e7d8d75 /camel/camel-filter-search.c
parent8187001a14295b4b64cc3e973fb1ab1e551133f2 (diff)
downloadgsoc2013-evolution-8e1251fa17b522d0539a8fcfb7463ba8cef1b31a.tar
gsoc2013-evolution-8e1251fa17b522d0539a8fcfb7463ba8cef1b31a.tar.gz
gsoc2013-evolution-8e1251fa17b522d0539a8fcfb7463ba8cef1b31a.tar.bz2
gsoc2013-evolution-8e1251fa17b522d0539a8fcfb7463ba8cef1b31a.tar.lz
gsoc2013-evolution-8e1251fa17b522d0539a8fcfb7463ba8cef1b31a.tar.xz
gsoc2013-evolution-8e1251fa17b522d0539a8fcfb7463ba8cef1b31a.tar.zst
gsoc2013-evolution-8e1251fa17b522d0539a8fcfb7463ba8cef1b31a.zip
merged spam filtering branch
svn path=/trunk/; revision=23302
Diffstat (limited to 'camel/camel-filter-search.c')
-rw-r--r--camel/camel-filter-search.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c
index 8af3392e71..5897239164 100644
--- a/camel/camel-filter-search.c
+++ b/camel/camel-filter-search.c
@@ -91,6 +91,7 @@ static ESExpResult *get_current_date (struct _ESExp *f, int argc, struct _ESExpR
static ESExpResult *header_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
static ESExpResult *get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
static ESExpResult *pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
+static ESExpResult *junk_test (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
/* builtin functions */
static struct {
@@ -119,6 +120,7 @@ static struct {
{ "header-source", (ESExpFunc *) header_source, 0 },
{ "get-size", (ESExpFunc *) get_size, 0 },
{ "pipe-message", (ESExpFunc *) pipe_message, 0 },
+ { "junk-test", (ESExpFunc *) junk_test, 0 },
};
@@ -609,6 +611,23 @@ pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMess
return r;
}
+static ESExpResult *
+junk_test (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
+{
+ ESExpResult *r;
+ gboolean retval = FALSE;
+
+ if (fms->session->junk_plugin != NULL) {
+ retval = camel_junk_plugin_check_junk (fms->session->junk_plugin, camel_filter_search_get_message (fms, f));
+
+ fprintf (stderr, "junk filter => %s\n", retval ? "*JUNK*" : "clean");
+ }
+ r = e_sexp_result_new (f, ESEXP_RES_BOOL);
+ r->value.number = retval;
+
+ return r;
+}
+
/**
* camel_filter_search_match: