aboutsummaryrefslogtreecommitdiffstats
path: root/rules/misc.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-24 09:52:16 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-24 09:52:16 +0000
commita9f5845edaf3f1293df3a5ecc222fb5b10bf016a (patch)
tree542122e8d50ec9f1db3a43ec0126abdff0f513ab /rules/misc.lua
parent7021ddcc38a0f05b2bf69849f645a848e06be1e2 (diff)
downloadrspamd-a9f5845edaf3f1293df3a5ecc222fb5b10bf016a.tar.gz
rspamd-a9f5845edaf3f1293df3a5ecc222fb5b10bf016a.zip
[Minor] Remove all get_api_version calls
Diffstat (limited to 'rules/misc.lua')
-rw-r--r--rules/misc.lua32
1 files changed, 13 insertions, 19 deletions
diff --git a/rules/misc.lua b/rules/misc.lua
index e289215c9..21b236fda 100644
--- a/rules/misc.lua
+++ b/rules/misc.lua
@@ -56,11 +56,9 @@ rspamd_config.R_PARTS_DIFFER = {
-- Date issues
rspamd_config.MISSING_DATE = {
callback = function(task)
- if rspamd_config:get_api_version() >= 5 then
- local date = task:get_header_raw('Date')
- if date == nil or date == '' then
- return true
- end
+ local date = task:get_header_raw('Date')
+ if date == nil or date == '' then
+ return true
end
return false
end,
@@ -71,13 +69,11 @@ rspamd_config.MISSING_DATE = {
rspamd_config.DATE_IN_FUTURE = {
callback = function(task)
- if rspamd_config:get_api_version() >= 5 then
- local dm = task:get_date{format = 'message', gmt = true}
- local dt = task:get_date{format = 'connect', gmt = true}
- -- 2 hours
- if dm > 0 and dm - dt > 7200 then
- return true
- end
+ local dm = task:get_date{format = 'message', gmt = true}
+ local dt = task:get_date{format = 'connect', gmt = true}
+ -- 2 hours
+ if dm > 0 and dm - dt > 7200 then
+ return true
end
return false
end,
@@ -88,13 +84,11 @@ rspamd_config.DATE_IN_FUTURE = {
rspamd_config.DATE_IN_PAST = {
callback = function(task)
- if rspamd_config:get_api_version() >= 5 then
- local dm = task:get_date{format = 'message', gmt = true}
- local dt = task:get_date{format = 'connect', gmt = true}
- -- A day
- if dm > 0 and dt - dm > 86400 then
- return true
- end
+ local dm = task:get_date{format = 'message', gmt = true}
+ local dt = task:get_date{format = 'connect', gmt = true}
+ -- A day
+ if dm > 0 and dt - dm > 86400 then
+ return true
end
return false
end,