diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-06 18:33:42 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-06 18:33:42 +0000 |
commit | 9347accacebdcb3015999cc9e04664e54c6535bb (patch) | |
tree | 62eca0234b72350b1f4d2b28d4bc0adbaecf3d80 /src/plugins | |
parent | e7cdc37c932d82db4fa026e1754ea2cd651a0620 (diff) | |
download | rspamd-9347accacebdcb3015999cc9e04664e54c6535bb.tar.gz rspamd-9347accacebdcb3015999cc9e04664e54c6535bb.zip |
Fix replacements in spamassassin plugin
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/spamassassin.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua index ea7b28ffe..24ec601dc 100644 --- a/src/plugins/lua/spamassassin.lua +++ b/src/plugins/lua/spamassassin.lua @@ -881,14 +881,17 @@ _.each(function(r) if rule['re_expr'] and rule['re'] then local res,nexpr = apply_replacements(rule['re_expr']) if res then - local nre = rspamd_regexp.create_cached(nexpr) + local nre = rspamd_regexp.create(nexpr) if not nre then rspamd_logger.errx(rspamd_config, 'cannot apply replacement for rule %1', r) rule['re'] = nil else rspamd_logger.debugx(rspamd_config, 'replace %1 -> %2', r, nexpr) + rspamd_config:replace_regexp({ + old_re = rule['re'], + new_re = nre + }) rule['re'] = nre - -- XXX: add removal from the cache logic rule['re_expr'] = nexpr nre:set_limit(match_limit) end |