diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-17 14:34:58 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-17 14:34:58 +0100 |
commit | 8621808de74f03e87c5c5ae747c7b948f1d06ca6 (patch) | |
tree | 18ffe617657126ede1f3701d6b2b8ef0271e98cc /rules/headers_checks.lua | |
parent | 18af41ce00a593cb177b2401e573e4d0ef2747f2 (diff) | |
download | rspamd-8621808de74f03e87c5c5ae747c7b948f1d06ca6.tar.gz rspamd-8621808de74f03e87c5c5ae747c7b948f1d06ca6.zip |
[Rules] Add MULTIPLE_FROM rule
Diffstat (limited to 'rules/headers_checks.lua')
-rw-r--r-- | rules/headers_checks.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/rules/headers_checks.lua b/rules/headers_checks.lua index 0f578a448..ed2172fcd 100644 --- a/rules/headers_checks.lua +++ b/rules/headers_checks.lua @@ -563,6 +563,27 @@ rspamd_config.MISSING_FROM = { group = 'headers', description = 'Missing From: header' } + +rspamd_config.MULTIPLE_FROM = { + callback = function(task) + local from = task:get_from('mime') + if from and from[1] then + if #from > 1 then + return true,1.0,table.concat( + fun.totable( + fun.map(function(a) return a.addr end, + fun.filter(function(a) return a.addr and a.addr ~= '' end, + from))), + ',') + end + end + return false + end, + score = 9.0, + group = 'headers', + description = 'Multiple addresses in From' +} + rspamd_config.MV_CASE = { callback = function (task) local mv = task:get_header('Mime-Version', true) |