aboutsummaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-28 14:36:20 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-28 14:36:20 +0100
commit56b2c0c5f00919a478e3ee7a42b25860340ffc6b (patch)
tree672432ee3ad4defc3da561f390b3df5131119605 /rules
parent557cad5d0aee29dc8900b4fa6922fcff379244d1 (diff)
downloadrspamd-56b2c0c5f00919a478e3ee7a42b25860340ffc6b.tar.gz
rspamd-56b2c0c5f00919a478e3ee7a42b25860340ffc6b.zip
[Feature] Add URL_IN_SUBJECT rule
Diffstat (limited to 'rules')
-rw-r--r--rules/misc.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/rules/misc.lua b/rules/misc.lua
index 57c3ac057..07af50c12 100644
--- a/rules/misc.lua
+++ b/rules/misc.lua
@@ -349,6 +349,31 @@ rspamd_config.OMOGRAPH_URL = {
description = 'Url contains both latin and non-latin characters'
}
+rspamd_config.URL_IN_SUBJECT = {
+ callback = function(task)
+ local urls = task:get_urls()
+
+ if urls then
+ for _,u in ipairs(urls) do
+ if u:is_subject() then
+ local subject = task:get_subject()
+
+ if subject then
+ if tostring(u) == subject then
+ return true,1.0,u:get_host()
+ end
+ end
+ return true,0.5,u:get_host()
+ end
+ end
+ end
+
+ return false
+ end,
+ score = 2.0,
+ description = 'Url found in Subject'
+}
+
local aliases_id = rspamd_config:register_symbol{
type = 'prefilter',
name = 'EMAIL_PLUS_ALIASES',