]> source.dussan.org Git - rspamd.git/commitdiff
Fix: if not exist Date-header 140/head
authorAlexey AL <AlexeySa@users.noreply.github.com>
Sat, 7 Feb 2015 15:46:31 +0000 (18:46 +0300)
committerAlexey AL <AlexeySa@users.noreply.github.com>
Sat, 7 Feb 2015 15:46:31 +0000 (18:46 +0300)
conf/lua/rspamd.lua

index 1b06fdc1a22e47c0256835a34ea777b29e2bad07..3aa03224418ca4e4d2ebe3928d1c63663f39cb59 100644 (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 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