Browse Source

Fix: if not exist Date-header

tags/0.9.0
Alexey AL 9 years ago
parent
commit
b460a002a0
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      conf/lua/rspamd.lua

+ 3
- 3
conf/lua/rspamd.lua View File

@@ -45,8 +45,8 @@ rspamd_config.DATE_IN_FUTURE = function(task)
if rspamd_config:get_api_version() >= 5 then
local dm = task:get_date{format = 'message'}
local dt = task:get_date{format = 'connect'}
-- An hour
if dm - dt > 7200 then
-- An 2 hour
if dm > 0 and dm - dt > 7200 then
return true
end
end
@@ -58,7 +58,7 @@ rspamd_config.DATE_IN_PAST = function(task)
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
if dm > 0 and dt - dm > 86400 then
return true
end
end

Loading…
Cancel
Save