From: Vsevolod Stakhov Date: Tue, 26 May 2015 16:37:45 +0000 (+0100) Subject: If replacement cannot be applied, just remove regexp. X-Git-Tag: 1.0.0~609 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d6dc66ed1ec6165386e820daaff501b8c52b90df;p=thirdparty%2Frspamd.git If replacement cannot be applied, just remove regexp. --- diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua index 9c25b67b60..1fc175b0b7 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