diff options
author | Anton Yuzhaninov <citrin+git@citrin.ru> | 2020-10-07 11:57:37 +0100 |
---|---|---|
committer | Anton Yuzhaninov <citrin+git@citrin.ru> | 2020-10-07 11:57:37 +0100 |
commit | ce9394561d07edfb9ff14d5a7e3ece2722c24a24 (patch) | |
tree | ceb19d20e8291f1fde36c352b82471d4e68050cc /rules | |
parent | ee429ed73788f3e6f7f39cc1fe6b1deee50c341b (diff) | |
download | rspamd-ce9394561d07edfb9ff14d5a7e3ece2722c24a24.tar.gz rspamd-ce9394561d07edfb9ff14d5a7e3ece2722c24a24.zip |
[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.
Diffstat (limited to 'rules')
-rw-r--r-- | rules/misc.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rules/misc.lua b/rules/misc.lua index d12e09e2c..870952c94 100644 --- a/rules/misc.lua +++ b/rules/misc.lua @@ -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 }) |