summaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/spamassassin.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/lua/spamassassin.lua')
-rw-r--r--src/plugins/lua/spamassassin.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua
index 649abc51f..39ca8e327 100644
--- a/src/plugins/lua/spamassassin.lua
+++ b/src/plugins/lua/spamassassin.lua
@@ -152,10 +152,6 @@ local function replace_symbol(s)
return rspamd_symbol, true
end
-local function trim(s)
- return s:match "^%s*(.-)%s*$"
-end
-
local ffi
if type(jit) == 'table' then
ffi = require("ffi")
@@ -702,7 +698,9 @@ local function process_sa_conf(f)
local if_nested = 0
for l in f:lines() do
(function ()
- l = trim(l)
+ l = lua_util.rspamd_str_trim(l)
+ -- Replace bla=~/re/ with bla =~ /re/ (#2372)
+ l = l:gsub('([^%s])%s*=~%s*([^%s])', '%1 =~ %2')
if string.len(l) == 0 or string.sub(l, 1, 1) == '#' then
return