diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-16 14:46:43 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-16 14:46:43 +0100 |
commit | f8e570d1c3f934c044bcd7a594a941d088ba525f (patch) | |
tree | 788e0064ee9a9e6496c9a81c67ad04907120b45c /rules | |
parent | 9b3949e02de3292c42bf659cb1f0dfe234d0afa9 (diff) | |
download | rspamd-f8e570d1c3f934c044bcd7a594a941d088ba525f.tar.gz rspamd-f8e570d1c3f934c044bcd7a594a941d088ba525f.zip |
[Fix] Ignore Rmilter added Received
Issue: #1587
Diffstat (limited to 'rules')
-rw-r--r-- | rules/misc.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/rules/misc.lua b/rules/misc.lua index 0d83fa02a..6e4366788 100644 --- a/rules/misc.lua +++ b/rules/misc.lua @@ -193,15 +193,21 @@ local check_rcvd = rspamd_config:register_symbol{ local rcvds = task:get_received_headers() if not rcvds then return false end - local tls = fun.all(function(rc) + local all_tls = fun.all(function(rc) return rc.flags and rc.flags['ssl'] - end, rcvds) + end, fun.filter(function(rc) + return rc.by and rc.by ~= 'localhost' + end, rcvds)) -- See if only the last hop was encrypted - if tls then + if all_tls then task:insert_result('RCVD_TLS_ALL', 1.0) else local rcvd = rcvds[1] + if rcvd.by and rcvd.by == 'localhost' then + -- Ignore artificial header from Rmilter + rcvd = rcvds[2] + end if rcvd.flags and rcvd.flags['ssl'] then task:insert_result('RCVD_TLS_LAST', 1.0) else |