diff options
author | Anton Yuzhaninov <citrin+git@citrin.ru> | 2021-04-27 16:50:04 +0100 |
---|---|---|
committer | Anton Yuzhaninov <citrin+git@citrin.ru> | 2021-04-27 16:53:41 +0100 |
commit | 8a5448883ef9eb62ce169acdd2729f5b4ff6ad2d (patch) | |
tree | 8e5fc5bc78b65d99e0ae77b4ed2248499b9f683a /rules | |
parent | b3d5173446073c34730db64360ca7454f42810a3 (diff) | |
download | rspamd-8a5448883ef9eb62ce169acdd2729f5b4ff6ad2d.tar.gz rspamd-8a5448883ef9eb62ce169acdd2729f5b4ff6ad2d.zip |
[Rules] Add raw addresses to MULTIPLE_FROM options
It is confusing to have MULTIPLE_FROM with a single address in options,
which happens if one of addresses is empty - usually because of
misplaces <>. While here simplify condition.
Diffstat (limited to 'rules')
-rw-r--r-- | rules/headers_checks.lua | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/rules/headers_checks.lua b/rules/headers_checks.lua index 79b8e5c2f..f0f64daff 100644 --- a/rules/headers_checks.lua +++ b/rules/headers_checks.lua @@ -576,15 +576,8 @@ rspamd_config.MISSING_FROM = { 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 + if from and from[2] then + return true, 1.0, fun.totable(fun.map(function(a) return a.raw end, from)) end return false end, |