diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-01-21 17:25:06 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-01-21 17:25:06 +0300 |
commit | 1dc0f6ad2c2e97e11881a7e1b0a4142e65f50898 (patch) | |
tree | f0a714e2e87ebd50f6016c8cc7f2a8e03a9cc2d8 /src/plugins | |
parent | 87c9659fdd08bbbc0eb796afccf7237a03181498 (diff) | |
download | rspamd-1dc0f6ad2c2e97e11881a7e1b0a4142e65f50898.tar.gz rspamd-1dc0f6ad2c2e97e11881a7e1b0a4142e65f50898.zip |
* Rewrite message parser
* Change mime parts storage
* Add html tags striping (ported from php code)
* Rework learning to process only text and striped html parts
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/regexp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index f82543a7e..6722e7b92 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -19,6 +19,7 @@ #include "../config.h" #include "../main.h" +#include "../message.h" #include "../modules.h" #include "../cfg_file.h" @@ -125,6 +126,7 @@ process_regexp (struct rspamd_regexp *re, struct worker_task *task) { char *headerv; struct mime_part *part; + GList *cur; struct uri *url; switch (re->type) { @@ -155,10 +157,13 @@ process_regexp (struct rspamd_regexp *re, struct worker_task *task) break; case REGEXP_MIME: msg_debug ("process_regexp: checking mime regexp: /%s/", re->regexp_text); - TAILQ_FOREACH (part, &task->parts, next) { + cur = g_list_first (task->parts); + while (cur) { + part = (struct mime_part *)cur->data; if (g_regex_match_full (re->regexp, part->content->data, part->content->len, 0, 0, NULL, NULL) == TRUE) { return 1; } + cur = g_list_next (cur); } return 0; case REGEXP_MESSAGE: |