diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-02-02 18:55:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-02 18:55:21 +0000 |
commit | f99dab02f8dfd97ce81a3827e2f17df6c24b9d1a (patch) | |
tree | dbaba45d4bcc16a425d38178e123394a0df61f2f | |
parent | dc8a101d311c6a468c34177cde5895dc5861ab61 (diff) | |
parent | 1cea94cbfe4318b58ea24635103f84e099b3940d (diff) | |
download | rspamd-f99dab02f8dfd97ce81a3827e2f17df6c24b9d1a.tar.gz rspamd-f99dab02f8dfd97ce81a3827e2f17df6c24b9d1a.zip |
Merge pull request #2008 from smfreegard/rules_20180130
Add REPLYTO_EQ_TO_ADDR rule
-rw-r--r-- | rules/headers_checks.lua | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/rules/headers_checks.lua b/rules/headers_checks.lua index e9f26117e..334e0ab93 100644 --- a/rules/headers_checks.lua +++ b/rules/headers_checks.lua @@ -217,8 +217,14 @@ local check_replyto_id = rspamd_config:register_callback_symbol('CHECK_REPLYTO', elseif from[1].domain and rt[1].domain then if (util.strequal_caseless(from[1].domain, rt[1].domain)) then task:insert_result('REPLYTO_DOM_EQ_FROM_DOM', 1.0) - else - task:insert_result('REPLYTO_DOM_NEQ_FROM_DOM', 1.0) + else + -- See if Reply-To matches the To address + local to = task:get_recipients(2) + if (to and to[1] and to[1].addr:lower() == rt[1].addr:lower()) then + task:insert_result('REPLYTO_EQ_TO_ADDR', 1.0) + else + task:insert_result('REPLYTO_DOM_NEQ_FROM_DOM', 1.0) + end end end -- See if the Display Names match @@ -295,6 +301,15 @@ rspamd_config:register_symbol{ description = 'Reply-To header has title', group = 'headers', } +rspamd_config:register_symbol{ + name = 'REPLYTO_EQ_TO_ADDR', + score = 5.0, + parent = check_replyto_id, + type = 'virtual', + description = 'Reply-To is the same as the To address', + group = 'headers', +} + rspamd_config:register_dependency(check_replyto_id, 'FROM_NAME_HAS_TITLE') local check_mime_id = rspamd_config:register_symbol{ |