diff options
author | Anton Yuzhaninov <citrin+git@citrin.ru> | 2020-05-01 13:43:42 +0100 |
---|---|---|
committer | Anton Yuzhaninov <citrin+git@citrin.ru> | 2020-05-01 14:03:17 +0100 |
commit | e45b8715fe439e7b254e55b0da207aed371eaa8f (patch) | |
tree | 1c936dcf23ec66c87f8a6fbcd19c5f68718ed6ae /rules/headers_checks.lua | |
parent | d01de01be22e81accd84a7f346b27269c3c91990 (diff) | |
download | rspamd-e45b8715fe439e7b254e55b0da207aed371eaa8f.tar.gz rspamd-e45b8715fe439e7b254e55b0da207aed371eaa8f.zip |
[Fix] Fix FROM_NEQ_ENVFROM
Regression was introduced in 23675060063301aaa3c93044e0029fda553d4e8f
Diffstat (limited to 'rules/headers_checks.lua')
-rw-r--r-- | rules/headers_checks.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/rules/headers_checks.lua b/rules/headers_checks.lua index 6c5489822..ec8208d8c 100644 --- a/rules/headers_checks.lua +++ b/rules/headers_checks.lua @@ -656,13 +656,14 @@ local check_from_id = rspamd_config:register_symbol{ task:insert_result('FROM_NAME_EXCESS_SPACE', 1.0) end end - if (envfrom and envfrom[1] and - util.strequal_caseless(envfrom[1].addr, from[1].addr)) - then - task:insert_result('FROM_EQ_ENVFROM', 1.0) + + if envfrom then + if util.strequal_caseless(envfrom[1].addr, from[1].addr) then + task:insert_result('FROM_EQ_ENVFROM', 1.0) + elseif envfrom[1].addr ~= '' then + task:insert_result('FROM_NEQ_ENVFROM', 1.0, from[1].addr, envfrom[1].addr) + end end - elseif (envfrom and envfrom[1] and envfrom[1].addr) then - task:insert_result('FROM_NEQ_ENVFROM', 1.0, ((from or E)[1] or E).addr or '', envfrom[1].addr) end local to = task:get_recipients(2) |