diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-26 17:37:45 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-26 17:37:45 +0100 |
commit | d6dc66ed1ec6165386e820daaff501b8c52b90df (patch) | |
tree | ad632e123b0cb07cadc49d54e29998260286afb2 /src/plugins | |
parent | d4ec1102cf94bff0c4c58018c42b49def64bd267 (diff) | |
download | rspamd-d6dc66ed1ec6165386e820daaff501b8c52b90df.tar.gz rspamd-d6dc66ed1ec6165386e820daaff501b8c52b90df.zip |
If replacement cannot be applied, just remove regexp.
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/spamassassin.lua | 4 |
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 |