aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-26 17:37:45 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-26 17:38:30 +0100
commite57e401c728e565c15c239e54b2ad36b3c01c62c (patch)
tree1df22ec97b4eaaaccba21f82b77c16cabbc482bb
parentc2c2dc9a118d25fa7604b4256f16ead49036fa1f (diff)
downloadrspamd-e57e401c728e565c15c239e54b2ad36b3c01c62c.tar.gz
rspamd-e57e401c728e565c15c239e54b2ad36b3c01c62c.zip
If replacement cannot be applied, just remove regexp.
-rw-r--r--src/plugins/lua/spamassassin.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua
index 9c25b67b6..1fc175b0b 100644
--- a/src/plugins/lua/spamassassin.lua
+++ b/src/plugins/lua/spamassassin.lua
@@ -524,6 +524,9 @@ end
local function sa_regexp_match(data, re, raw, rule)
local res = 0
+ if not re then
+ return 0
+ end
if rule['multiple'] then
local lim = -1
if rule['maxhits'] then
@@ -628,6 +631,7 @@ _.each(function(r)
local nre = rspamd_regexp.create_cached(nexpr)
if not nre then
rspamd_logger.errx('cannot apply replacement for rule %1', r)
+ rule['re'] = nil
else
rspamd_logger.debugx('replace %1 -> %2', r, nexpr)
rule['re'] = nre