diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-09-04 14:16:42 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-09-04 14:16:42 +0100 |
commit | 3f78f1f7213afded0029efcf439556c628971b17 (patch) | |
tree | 6ef49062b4cfd52cd69fbfb4632360f4c066666a | |
parent | 56266ef6477f272aa3c1011f89f2f5824edecda8 (diff) | |
download | rspamd-3f78f1f7213afded0029efcf439556c628971b17.tar.gz rspamd-3f78f1f7213afded0029efcf439556c628971b17.zip |
Fix DATE_IN_PAST and DATE_IN_FUTURE
-rw-r--r-- | conf/lua/rspamd.lua | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/conf/lua/rspamd.lua b/conf/lua/rspamd.lua index 38f5ae94b..87fac1dc1 100644 --- a/conf/lua/rspamd.lua +++ b/conf/lua/rspamd.lua @@ -43,9 +43,8 @@ end -- Date issues rspamd_config.DATE_IN_FUTURE = function(task) if rspamd_config:get_api_version() >= 5 then - local m = task:get_message() - local dm = m:get_date() - local dt = task:get_date() + local dm = task:get_date{format = 'message'} + local dt = task:get_date{format = 'connect'} -- An hour if dm - dt > 3600 then return true @@ -56,9 +55,8 @@ rspamd_config.DATE_IN_FUTURE = function(task) end rspamd_config.DATE_IN_PAST = function(task) if rspamd_config:get_api_version() >= 5 then - local m = task:get_message() - local dm = m:get_date() - local dt = task:get_date() + 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 |