From 4e4876ac8d2249b7275f059b0763104a2ba4f1eb Mon Sep 17 00:00:00 2001 From: Alexey AL Date: Sun, 21 Aug 2016 14:44:02 +0300 Subject: [PATCH] [Feature] Add Yandex and Mail.ru forwarding rules --- rules/forwarding.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/rules/forwarding.lua b/rules/forwarding.lua index 65c5e3100..df9a97b80 100644 --- a/rules/forwarding.lua +++ b/rules/forwarding.lua @@ -45,6 +45,42 @@ rspamd_config.FWD_GOOGLE = { group = "forwarding" } +rspamd_config.FWD_YANDEX = { + callback = function (task) + if not (task:has_from(1) and task:has_recipients(1)) then + return false + end + local hostname = task:get_hostname() + if hostname and hostname:lower():find('%.yandex%.[a-z]+$') then + if task:get_header_raw('X-Yandex-Forward') then + return true + end + end + return false + end, + score = 0.0, + description = "Message was forwarded by Yandex", + group = "forwarding" +} + +rspamd_config.FWD_MAILRU = { + callback = function (task) + if not (task:has_from(1) and task:has_recipients(1)) then + return false + end + local hostname = task:get_hostname() + if hostname and hostname:lower():find('%.mail%.ru$') then + if task:get_header_raw('X-MailRu-Forward') then + return true + end + end + return false + end, + score = 0.0, + description = "Message was forwarded by Mail.ru", + group = "forwarding1" +} + rspamd_config.FWD_SRS = { callback = function (task) if not (task:has_from(1) and task:has_recipients(1)) then -- 2.39.5