From: Alexey AL Date: Sat, 7 Feb 2015 15:46:31 +0000 (+0300) Subject: Fix: if not exist Date-header X-Git-Tag: 0.8.2~47^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a89caaee42ea1eef2afee7cbb03508c7d7b97de5;p=thirdparty%2Frspamd.git Fix: if not exist Date-header --- diff --git a/conf/lua/rspamd.lua b/conf/lua/rspamd.lua index c35e15d983..6043f243c4 100644 --- a/conf/lua/rspamd.lua +++ b/conf/lua/rspamd.lua @@ -80,8 +80,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 @@ -93,7 +93,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