-- 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,
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,
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,
* and add the corresponding symbols to the scan's results.
@example
rspamd_config.DATE_IN_PAST = 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 dt - dm > 86400 then
- return true
- end
+ -- A day
+ if dt - dm > 86400 then
+ return true
end
return false