aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-10-26 21:38:03 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-10-26 21:38:03 +0400
commit81fd72379a9b16aac7905d59bf76acfdd2f4e03e (patch)
tree2f01a0268d58da15fa1814f5a2ddd78baa06f6b5 /src/plugins
parent67e60b72919e9c33b25da7088a92c03d591ecf3f (diff)
downloadrspamd-81fd72379a9b16aac7905d59bf76acfdd2f4e03e.tar.gz
rspamd-81fd72379a9b16aac7905d59bf76acfdd2f4e03e.zip
Add add_header action to smtp proxy.
In raw mode scan stripped html parts when regexp are not 'raw'.
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/regexp.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c
index c70b5d232..8a33402f2 100644
--- a/src/plugins/regexp.c
+++ b/src/plugins/regexp.c
@@ -613,6 +613,8 @@ process_regexp (struct rspamd_regexp *re, struct worker_task *task, const gchar
.re = re,
.found = FALSE
};
+ guint8 *ct;
+ gsize clen;
gint r;
@@ -710,8 +712,15 @@ process_regexp (struct rspamd_regexp *re, struct worker_task *task, const gchar
else {
regexp = re->regexp;
}
-
- if (g_regex_match_full (regexp, part->orig->data, part->orig->len, 0, 0, NULL, &err) == TRUE) {
+ if (re->is_raw) {
+ ct = part->orig->data;
+ clen = part->orig->len;
+ }
+ else {
+ ct = part->content->data;
+ clen = part->content->len;
+ }
+ if (g_regex_match_full (regexp, ct, clen, 0, 0, NULL, &err) == TRUE) {
if (G_UNLIKELY (re->is_test)) {
msg_info ("process test regexp %s for mime part returned TRUE", re->regexp_text);
}