Browse Source

[Minor] Add option for DATE_IN_PAST/DATE_IN_FUTURE symbols

Value for an option is the number of full hours the date of the message
is in the past or future.
tags/2.7
Anton Yuzhaninov 3 years ago
parent
commit
ce9394561d
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      rules/misc.lua

+ 2
- 2
rules/misc.lua View File

@@ -76,10 +76,10 @@ local date_id = rspamd_config:register_symbol({

if date_diff > 86400 then
-- Older than a day
task:insert_result('DATE_IN_PAST', 1.0)
task:insert_result('DATE_IN_PAST', 1.0, tostring(math.floor(date_diff/3600)))
elseif -date_diff > 7200 then
-- More than 2 hours in the future
task:insert_result('DATE_IN_FUTURE', 1.0)
task:insert_result('DATE_IN_FUTURE', 1.0, tostring(math.floor(-date_diff/3600)))
end
end
})

Loading…
Cancel
Save