소스 검색

Fix RCVD_TLS_ALL and add RCVD_TLS_LAST

tags/1.5.4
Steve Freegard 7 년 전
부모
커밋
3458e67a9e
2개의 변경된 파일49개의 추가작업 그리고 16개의 파일을 삭제
  1. 49
    8
      rules/misc.lua
  2. 0
    8
      rules/regexp/headers.lua

+ 49
- 8
rules/misc.lua 파일 보기

@@ -187,20 +187,61 @@ rspamd_config.ENVFROM_VERP = {
group = "mailing_list"
}

rspamd_config.RCVD_TLS_ALL = {
local check_rcvd = rspamd_config:register_symbol{
name = 'CHECK_RCVD',
callback = function (task)
local rcvds = task:get_header_full('Received')
local rcvds = task:get_received_headers()
if not rcvds then return false end

local ret = fun.all(function(rc)
return rc.flags and (rc.flags['ssl'] or rc.flags['authenticated'])
local tls = fun.all(function(rc)
return rc.flags and rc.flags['ssl']
end, rcvds)

return ret
end,
-- See if only the last hop was encrypted
if tls then
task:insert_result('RCVD_TLS_ALL', 1.0)
else
local rcvd = rcvds[1]
if rcvd.flags and rcvd.flags['ssl'] then
task:insert_result('RCVD_TLS_LAST', 1.0)
end
end

local auth = fun.any(function(rc)
return rc.flags and rc.flags['authenticated']
end, rcvds)

if auth then
task:insert_result('RCVD_VIA_SMTP_AUTH', 1.0)
end
end
}

rspamd_config:register_symbol{
type = 'virtual',
parent = check_rcvd,
name = 'RCVD_TLS_ALL',
description = 'All hops used encrypted transports',
score = 0.0,
group = 'encryption'
}

rspamd_config:register_symbol{
type = 'virtual',
parent = check_rcvd,
name = 'RCVD_TLS_LAST',
description = 'Last hop used encrypted transports',
score = 0.0,
group = 'encryption'
}

rspamd_config:register_symbol{
type = 'virtual',
parent = check_rcvd,
name = 'RCVD_VIA_SMTP_AUTH',
description = 'Message injected via SMTP AUTH',
score = 0.0,
description = "All hops used encrypted transports",
group = "encryption"
group = 'authentication'
}

rspamd_config.RCVD_HELO_USER = {

+ 0
- 8
rules/regexp/headers.lua 파일 보기

@@ -905,11 +905,3 @@ reconf['HAS_XOIP'] = {
score = 0.0,
group = 'headers'
}

reconf['RCVD_VIA_SMTP_AUTH'] = {
re = "Received=/\\bE?SMTPS?A\\b/ || Received=/\\bauthenticated\\b/i",
description = "Recieved using SMTP AUTH",
score = 0,
group = 'headers'
}


Loading…
취소
저장