summaryrefslogtreecommitdiffstats
path: root/rules/misc.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-06-06 12:32:12 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-06-06 12:32:12 +0100
commit541c7d94f20247ee0a0b61cf6da35b9e8e483cd8 (patch)
tree655cf4894c423f8c7fc8fc7627f6924fefe54f65 /rules/misc.lua
parentcfcfee6e154a7f6a833d329dbe4d93e7320f7862 (diff)
downloadrspamd-541c7d94f20247ee0a0b61cf6da35b9e8e483cd8.tar.gz
rspamd-541c7d94f20247ee0a0b61cf6da35b9e8e483cd8.zip
[Rules] Fix received TLS rules
Diffstat (limited to 'rules/misc.lua')
-rw-r--r--rules/misc.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/rules/misc.lua b/rules/misc.lua
index cf7ca3d42..147335e71 100644
--- a/rules/misc.lua
+++ b/rules/misc.lua
@@ -196,7 +196,7 @@ local check_rcvd = rspamd_config:register_symbol{
local all_tls = fun.all(function(rc)
return rc.flags and rc.flags['ssl']
end, fun.filter(function(rc)
- return rc.by and rc.by ~= 'localhost'
+ return rc.by_hostname and rc.by_hostname ~= 'localhost'
end, rcvds))
-- See if only the last hop was encrypted
@@ -204,11 +204,12 @@ local check_rcvd = rspamd_config:register_symbol{
task:insert_result('RCVD_TLS_ALL', 1.0)
else
local rcvd = rcvds[1]
- if rcvd.by and rcvd.by == 'localhost' then
+ if rcvd.by_hostname and rcvd.by_hostname == 'localhost' then
-- Ignore artificial header from Rmilter
- rcvd = rcvds[2]
+ rcvd = rcvds[2] or {}
end
if rcvd.flags and rcvd.flags['ssl'] then
+ local logger = require "rspamd_logger"
task:insert_result('RCVD_TLS_LAST', 1.0)
else
task:insert_result('RCVD_NO_TLS_LAST', 1.0)