[Rspamd] Add X-Last-TLS-Session-Version header
parent
a177499130
commit
9d04d0ee4a
|
@ -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',
|
||||||
|
|
Loading…
Reference in New Issue