aboutsummaryrefslogtreecommitdiffstats
path: root/conf/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-07 17:18:22 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-07 17:18:22 +0000
commit1e2ff82baa69251c79576609c2a94bd0c006cd72 (patch)
treed342bd0b992fc8714ed05b249d32791086d3ed35 /conf/lua
parentbc7c9c65040738fe8a3d7370b2f2347a215b6ceb (diff)
parentb460a002a03231555a54383deb233df93661af92 (diff)
downloadrspamd-1e2ff82baa69251c79576609c2a94bd0c006cd72.tar.gz
rspamd-1e2ff82baa69251c79576609c2a94bd0c006cd72.zip
Merge pull request #140 from AlexeySa/patch-3
Fix: if not exist Date-header
Diffstat (limited to 'conf/lua')
-rw-r--r--conf/lua/rspamd.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/conf/lua/rspamd.lua b/conf/lua/rspamd.lua
index aab77d5c4..4bc2d1f94 100644
--- a/conf/lua/rspamd.lua
+++ b/conf/lua/rspamd.lua
@@ -54,8 +54,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
@@ -67,7 +67,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