summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-08-21 16:04:19 +0100
committerGitHub <noreply@github.com>2016-08-21 16:04:19 +0100
commitbeb43bc463f33fa2c5ba5efeae7d4d1cb6fea3d1 (patch)
treec9090749f136aefc2839ff0b684d4cd7f75e2027
parent1774605d5b3966f4f53072b5a07d66b803930529 (diff)
parentcaa7e42ea154b3845e47e1540744bec1f4de9850 (diff)
downloadrspamd-beb43bc463f33fa2c5ba5efeae7d4d1cb6fea3d1.tar.gz
rspamd-beb43bc463f33fa2c5ba5efeae7d4d1cb6fea3d1.zip
Merge pull request #870 from AlexeySa/master
[Feature] Add Yandex and Mail.ru forwarding rules
-rw-r--r--conf/composites.conf3
-rw-r--r--rules/forwarding.lua36
2 files changed, 39 insertions, 0 deletions
diff --git a/conf/composites.conf b/conf/composites.conf
index edb5d3205..ee8c83ea7 100644
--- a/conf/composites.conf
+++ b/conf/composites.conf
@@ -23,6 +23,9 @@ composite "FORGED_SENDER_MAILLIST" {
composite "FORGED_SENDER_FORWARDING" {
expression = "FORGED_SENDER & g:forwarding";
}
+composite "FORWARDING_MAILRU" {
+ expression = "(FWD_MAILRU & (R_SPF_SOFTFAIL | R_SPF_FAIL)) | FWD_MAILRU";
+}
composite "FORGED_SENDER_VERP_SRS" {
expression = "FORGED_SENDER & (ENVFROM_PRVS | ENVFROM_VERP)";
}
diff --git a/rules/forwarding.lua b/rules/forwarding.lua
index 65c5e3100..002c9df7a 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 = "forwarding"
+}
+
rspamd_config.FWD_SRS = {
callback = function (task)
if not (task:has_from(1) and task:has_recipients(1)) then