diff options
author | Alexey AL <AlexeySa@users.noreply.github.com> | 2015-02-07 18:46:31 +0300 |
---|---|---|
committer | Alexey AL <AlexeySa@users.noreply.github.com> | 2015-02-07 18:46:31 +0300 |
commit | b460a002a03231555a54383deb233df93661af92 (patch) | |
tree | 0e0055c6c5c0383f3e958b3a24f70ccd8a1bf9a1 | |
parent | ca93090f76b1c4b5536489d6c42fc983802b4c49 (diff) | |
download | rspamd-b460a002a03231555a54383deb233df93661af92.tar.gz rspamd-b460a002a03231555a54383deb233df93661af92.zip |
Fix: if not exist Date-header
-rw-r--r-- | conf/lua/rspamd.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/conf/lua/rspamd.lua b/conf/lua/rspamd.lua index 1b06fdc1a..3aa032244 100644 --- a/conf/lua/rspamd.lua +++ b/conf/lua/rspamd.lua @@ -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 |