diff options
author | Steve Freegard <steve@stevefreegard.com> | 2017-04-19 16:01:56 +0100 |
---|---|---|
committer | Steve Freegard <steve@stevefreegard.com> | 2017-04-19 16:01:56 +0100 |
commit | 8d212c450236118db1dc592e6cac469b4e9d8f1d (patch) | |
tree | 8ff6d916143d780e0b97fe3961a1c55566a3505a /rules/misc.lua | |
parent | 0a614370e1c71c48ba0bc18a4dc3caecd26186bd (diff) | |
download | rspamd-8d212c450236118db1dc592e6cac469b4e9d8f1d.tar.gz rspamd-8d212c450236118db1dc592e6cac469b4e9d8f1d.zip |
Add INFO_TO_INFO_LU rule
Diffstat (limited to 'rules/misc.lua')
-rw-r--r-- | rules/misc.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/rules/misc.lua b/rules/misc.lua index 6eab5c85a..422edfcc3 100644 --- a/rules/misc.lua +++ b/rules/misc.lua @@ -568,3 +568,25 @@ rspamd_config.SPOOF_REPLYTO = { description = 'Reply-To is being used to spoof and trick the recipient to send an off-domain reply', score = 6.0 } + +rspamd_config.INFO_TO_INFO_LU = { + callback = function(task) + local lu = task:get_header('List-Unsubscribe') + if not lu then return false end + local from = task:get_from('mime') + if not (from and from[1] and util.strequal_caseless(from[1].user, 'info')) then + return false + end + local to = task:get_recipients('smtp') + local found = false + for _,r in ipairs(to) do + if util.strequal_caseless(r['user'], 'info') then + found = true + end + end + if found then return true end + return false + end, + description = 'info@ From/To address with List-Unsubscribe headers', + score = 2.0 +} |