aboutsummaryrefslogtreecommitdiffstats
path: root/conf
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-29 15:57:16 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-29 15:57:16 +0100
commit107f230637fbfe74fabc68a874b216944599de6c (patch)
tree39fdced138bd39347465dd98ea1348241268170a /conf
parentf0a9da38f3df5b4efa75be07df129f49932f2526 (diff)
downloadrspamd-107f230637fbfe74fabc68a874b216944599de6c.tar.gz
rspamd-107f230637fbfe74fabc68a874b216944599de6c.zip
Fix hfilter rule.
Diffstat (limited to 'conf')
-rw-r--r--conf/lua/hfilter.lua6
1 files changed, 1 insertions, 5 deletions
diff --git a/conf/lua/hfilter.lua b/conf/lua/hfilter.lua
index a9ff41f09..159b03a77 100644
--- a/conf/lua/hfilter.lua
+++ b/conf/lua/hfilter.lua
@@ -107,10 +107,6 @@ local config = {
['url_enabled'] = false
}
-local function trim1(s)
- return (s:gsub("^%s*(.-)%s*$", "%1"))
-end
-
local function check_regexp(str, regexp_text)
local re = rspamd_regexp.create_cached(regexp_text, 'i')
if re:match(str) then return true end
@@ -241,7 +237,7 @@ local function hfilter(task)
elseif text_parts_count == 1 and selected_text_part and selected_text_part:get_length() < 1024 then
-- We got a single text part with the total length < 1024 symbols.
local part_text = selected_text_part:get_content()
- if part_text and not string.find(trim1(part_text), "\n") then
+ if part_text and part_text:get_lines_count() < 2 then
task:insert_result('HFILTER_URL_ONELINE', 1.00)
end
end