Browse Source

Remove type='mime' and move MIME rules into their own group

pull/2954/head
Steve Freegard 6 years ago
parent
commit
3e0ceea8e0
  1. 39
      rules/headers_checks.lua

39
rules/headers_checks.lua

@ -25,7 +25,7 @@ local E = {}
local rcvd_cb_id = rspamd_config:register_symbol{ local rcvd_cb_id = rspamd_config:register_symbol{
name = 'CHECK_RECEIVED', name = 'CHECK_RECEIVED',
type = 'callback,mime',
type = 'callback',
score = 0.0, score = 0.0,
group = 'headers', group = 'headers',
callback = function(task) callback = function(task)
@ -114,7 +114,7 @@ rspamd_config:register_symbol{
local prio_cb_id = rspamd_config:register_symbol { local prio_cb_id = rspamd_config:register_symbol {
name = 'HAS_X_PRIO', name = 'HAS_X_PRIO',
type = 'callback,mime',
type = 'callback',
description = 'X-Priority check callback rule', description = 'X-Priority check callback rule',
score = 0.0, score = 0.0,
group = 'headers', group = 'headers',
@ -186,7 +186,7 @@ local function get_raw_header(task, name)
end end
local check_replyto_id = rspamd_config:register_symbol({ local check_replyto_id = rspamd_config:register_symbol({
type = 'callback,mime',
type = 'callback',
name = 'CHECK_REPLYTO', name = 'CHECK_REPLYTO',
score = 0.0, score = 0.0,
group = 'headers', group = 'headers',
@ -334,7 +334,7 @@ rspamd_config:register_dependency('CHECK_REPLYTO', 'CHECK_FROM')
local check_mime_id = rspamd_config:register_symbol{ local check_mime_id = rspamd_config:register_symbol{
name = 'CHECK_MIME', name = 'CHECK_MIME',
type = 'callback,mime',
type = 'callback',
group = 'headers', group = 'headers',
score = 0.0, score = 0.0,
callback = function(task) callback = function(task)
@ -576,7 +576,6 @@ rspamd_config.MISSING_FROM = {
return false return false
end, end,
score = 2.0, score = 2.0,
type = 'mime',
group = 'headers', group = 'headers',
description = 'Missing From: header' description = 'Missing From: header'
} }
@ -598,7 +597,6 @@ rspamd_config.MULTIPLE_FROM = {
end, end,
score = 9.0, score = 9.0,
group = 'headers', group = 'headers',
type = 'mime',
description = 'Multiple addresses in From' description = 'Multiple addresses in From'
} }
@ -609,8 +607,7 @@ rspamd_config.MV_CASE = {
end, end,
description = 'Mime-Version .vs. MIME-Version', description = 'Mime-Version .vs. MIME-Version',
score = 0.5, score = 0.5,
group = 'headers',
type = 'mime',
group = 'headers'
} }
rspamd_config.FAKE_REPLY = { rspamd_config.FAKE_REPLY = {
@ -625,13 +622,12 @@ rspamd_config.FAKE_REPLY = {
end, end,
description = 'Fake reply', description = 'Fake reply',
score = 1.0, score = 1.0,
group = 'headers',
type = 'mime',
group = 'headers'
} }
local check_from_id = rspamd_config:register_symbol{ local check_from_id = rspamd_config:register_symbol{
name = 'CHECK_FROM', name = 'CHECK_FROM',
type = 'callback,mime',
type = 'callback',
score = 0.0, score = 0.0,
group = 'headers', group = 'headers',
callback = function(task) callback = function(task)
@ -994,8 +990,7 @@ rspamd_config.CTYPE_MISSING_DISPOSITION = {
end, end,
description = 'Binary content-type not specified as an attachment', description = 'Binary content-type not specified as an attachment',
score = 4.0, score = 4.0,
type = 'mime',
group = 'headers'
group = 'mime'
} }
rspamd_config.CTYPE_MIXED_BOGUS = { rspamd_config.CTYPE_MIXED_BOGUS = {
@ -1023,8 +1018,7 @@ rspamd_config.CTYPE_MIXED_BOGUS = {
end, end,
description = 'multipart/mixed without non-textual part', description = 'multipart/mixed without non-textual part',
score = 1.0, score = 1.0,
type = 'mime',
group = 'headers'
group = 'mime'
} }
local function check_for_base64_text(part) local function check_for_base64_text(part)
@ -1060,8 +1054,7 @@ rspamd_config.MIME_BASE64_TEXT = {
end, end,
description = 'Has text part encoded in base64', description = 'Has text part encoded in base64',
score = 0.1, score = 0.1,
group = 'headers',
type = 'mime',
group = 'mime'
} }
rspamd_config.MIME_BASE64_TEXT_BOGUS = { rspamd_config.MIME_BASE64_TEXT_BOGUS = {
@ -1080,8 +1073,7 @@ rspamd_config.MIME_BASE64_TEXT_BOGUS = {
end, end,
description = 'Has text part encoded in base64 that does not contain any 8bit characters', description = 'Has text part encoded in base64 that does not contain any 8bit characters',
score = 1.0, score = 1.0,
group = 'headers',
type = 'mime',
group = 'mime'
} }
local function is_8bit_addr(addr) local function is_8bit_addr(addr)
@ -1102,8 +1094,7 @@ rspamd_config.INVALID_FROM_8BIT = {
end, end,
description = 'Invalid 8bit character in From header', description = 'Invalid 8bit character in From header',
score = 6.0, score = 6.0,
group = 'headers',
type = 'mime',
group = 'headers'
} }
rspamd_config.INVALID_RCPT_8BIT = { rspamd_config.INVALID_RCPT_8BIT = {
@ -1118,8 +1109,7 @@ rspamd_config.INVALID_RCPT_8BIT = {
end, end,
description = 'Invalid 8bit character in recipients headers', description = 'Invalid 8bit character in recipients headers',
score = 6.0, score = 6.0,
group = 'headers',
type = 'mime',
group = 'headers'
} }
rspamd_config.XM_CASE = { rspamd_config.XM_CASE = {
@ -1129,6 +1119,5 @@ rspamd_config.XM_CASE = {
end, end,
description = 'X-mailer .vs. X-Mailer', description = 'X-mailer .vs. X-Mailer',
score = 0.5, score = 0.5,
group = 'headers',
type = 'mime',
group = 'headers'
} }
Loading…
Cancel
Save