From: Vsevolod Stakhov Date: Mon, 20 Apr 2015 16:53:32 +0000 (+0100) Subject: Properly treat body rules. X-Git-Tag: 0.9.0~194 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=157021a7d38750954ddfefaa17409df202cb9a44;p=rspamd.git Properly treat body rules. --- diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua index be7bed344..8a5fc79b2 100644 --- a/src/plugins/lua/spamassassin.lua +++ b/src/plugins/lua/spamassassin.lua @@ -402,6 +402,7 @@ local function process_sa_conf(f) cur_rule['symbol'] = words[2] cur_rule['re_expr'] = words_to_re(words, 2) cur_rule['re'] = rspamd_regexp.create_cached(cur_rule['re_expr']) + cur_rule['raw'] = true if cur_rule['re'] and cur_rule['symbol'] then valid_rule = true end elseif words[1] == "rawbody" or words[1] == "full" and slash then -- body SYMBOL /regexp/ @@ -704,7 +705,7 @@ _.each(function(k, r) local content = part:get_content() local raw = false - if not part:is_utf() then raw = true end + if not part:is_utf() or r['raw'] then raw = true end return sa_regexp_match(content, r['re'], raw, r) end