diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-23 14:11:29 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-23 14:11:29 +0000 |
commit | 8e865ebfcb0fe584841c2e082acd894646569213 (patch) | |
tree | 910a0985ad6da3cbc7968b629da335fe6bac2987 /src/plugins | |
parent | 825932dd1b39839007463a7e4e85302bce1a269f (diff) | |
download | rspamd-8e865ebfcb0fe584841c2e082acd894646569213.tar.gz rspamd-8e865ebfcb0fe584841c2e082acd894646569213.zip |
[Feature] Support tag_exists SA function
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/spamassassin.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua index bb80ce6b2..2a3c04bfc 100644 --- a/src/plugins/lua/spamassassin.lua +++ b/src/plugins/lua/spamassassin.lua @@ -37,6 +37,7 @@ local known_plugins = { 'Mail::SpamAssassin::Plugin::BodyEval', 'Mail::SpamAssassin::Plugin::MIMEHeader', 'Mail::SpamAssassin::Plugin::WLBLEval', + 'Mail::SpamAssassin::Plugin::HTMLEval', } -- Table that replaces SA symbol with rspamd equialent @@ -520,6 +521,24 @@ local function gen_eval_rule(arg) return 0 end }, + { + 'html_tag_exists', + function(task, remain) + local tp = task:get_text_parts() + + for _,p in ipairs(tp) do + if p:is_html() then + local hc = p:get_html() + + if hc:has_tag(remain) then + return 1 + end + end + end + + return 0 + end + } } for _,f in ipairs(eval_funcs) do |