diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-23 11:36:36 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-23 11:36:36 +0000 |
commit | 21d5b7bd98961e6d088e2408a5a20c1fe0935671 (patch) | |
tree | 29e80e40a46d6265be77e2353f9f31b3ef5e2d19 /src/plugins/lua/spamassassin.lua | |
parent | a4275bebf7634e51a164aa186fc09e3581454519 (diff) | |
download | rspamd-21d5b7bd98961e6d088e2408a5a20c1fe0935671.tar.gz rspamd-21d5b7bd98961e6d088e2408a5a20c1fe0935671.zip |
Add 'check_relays_unparseable' support
Diffstat (limited to 'src/plugins/lua/spamassassin.lua')
-rw-r--r-- | src/plugins/lua/spamassassin.lua | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua index f766c8fb9..fb1998d98 100644 --- a/src/plugins/lua/spamassassin.lua +++ b/src/plugins/lua/spamassassin.lua @@ -41,7 +41,8 @@ local _ = require "fun" local known_plugins = { 'Mail::SpamAssassin::Plugin::FreeMail', 'Mail::SpamAssassin::Plugin::HeaderEval', - 'Mail::SpamAssassin::Plugin::ReplaceTags' + 'Mail::SpamAssassin::Plugin::ReplaceTags', + 'Mail::SpamAssassin::Plugin::RelayEval' } -- Internal variables @@ -235,6 +236,20 @@ local function gen_eval_rule(arg) end }, { + 'check_relays_unparseable', + function(task, remain) + local rh_mime = task:get_header_full('Received') + local rh_parsed = task:get_received_headers() + + local rh_cnt = 0 + if rh_mime then rh_cnt = #rh_mime end + local parsed_cnt = 0 + if rh_parsed then parsed_cnt = #rh_parsed end + + return rh_cnt - parsed_cnt + end + }, + { 'check_for_shifted_date', function (task, remain) -- Remain here contains two args: start and end hours shift |