From: Vsevolod Stakhov Date: Sat, 28 Jul 2018 13:06:57 +0000 (+0100) Subject: [Fix] Fix HTML part detection heuristic X-Git-Tag: 1.7.9~25 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b6e156e807a83b2b843929832869ccc3b6ecaec2;p=rspamd.git [Fix] Fix HTML part detection heuristic --- diff --git a/src/libmime/message.c b/src/libmime/message.c index 76f63ed1a..333748d16 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -676,11 +676,13 @@ rspamd_message_process_text_part (struct rspamd_task *task, RSPAMD_FTOK_ASSIGN (&xhtml_tok, "parsed_data.len >= xhtml_tok.len && - rspamd_lc_cmp (mime_part->parsed_data.begin, xhtml_tok.begin, xhtml_tok.len)) { + rspamd_lc_cmp (mime_part->parsed_data.begin, + xhtml_tok.begin, xhtml_tok.len) == 0) { found_html = TRUE; } else if (mime_part->parsed_data.len >= html_tok.len && - rspamd_lc_cmp (mime_part->parsed_data.begin, html_tok.begin, html_tok.len)) { + rspamd_lc_cmp (mime_part->parsed_data.begin, + html_tok.begin, html_tok.len) == 0) { found_html = TRUE; } else { diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index 18a66a23f..303f97d0e 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -413,6 +413,7 @@ local function multimap_callback(task, rule) table.insert(srch, nip) end end + table.insert(srch, 1, r['redis_key']) ret = rspamd_redis_make_request(task, redis_params, -- connect params @@ -759,6 +760,7 @@ local function multimap_callback(task, rule) url = function() if task:has_urls() then local msg_urls = task:get_urls() + for _,url in ipairs(msg_urls) do match_url(rule, url) end @@ -1095,6 +1097,8 @@ if opts and type(opts) == 'table' then if not rule then rspamd_logger.errx(rspamd_config, 'cannot add rule: "'..k..'"') else + rspamd_logger.infox(rspamd_config, 'added multimap rule: %s (%s)', + k, rule.type) table.insert(rules, rule) end end