[Rspamd] Add X-Last-TLS-Session-Version header

master
andryyy 2020-02-09 19:08:28 +01:00
parent a177499130
commit 9d04d0ee4a
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
1 changed files with 20 additions and 0 deletions

View File

@ -7,6 +7,7 @@ rspamd_config.MAILCOW_AUTH = {
end end
} }
rspamd_config:register_symbol({ rspamd_config:register_symbol({
name = 'KEEP_SPAM', name = 'KEEP_SPAM',
type = 'prefilter', type = 'prefilter',
@ -69,6 +70,25 @@ rspamd_config:register_symbol({
priority = 19 priority = 19
}) })
rspamd_config:register_symbol({
name = 'TLS_HEADER',
type = 'postfilter',
callback = function(task)
local rspamd_logger = require "rspamd_logger"
local tls_tag = task:get_request_header('TLS-Version')
if type(tls_tag) == 'nil' then
task:set_milter_reply({
add_headers = {['X-Last-TLS-Session-Version'] = 'None'}
})
else
task:set_milter_reply({
add_headers = {['X-Last-TLS-Session-Version'] = tostring(tls_tag)}
})
end
end,
priority = 12
})
rspamd_config:register_symbol({ rspamd_config:register_symbol({
name = 'TAG_MOO', name = 'TAG_MOO',
type = 'postfilter', type = 'postfilter',