Ver código fonte

Rules fixes

tags/1.5.4
Steve Freegard 7 anos atrás
pai
commit
1f0efdff27
2 arquivos alterados com 14 adições e 7 exclusões
  1. 13
    6
      rules/misc.lua
  2. 1
    1
      rules/regexp/misc.lua

+ 13
- 6
rules/misc.lua Ver arquivo

@@ -456,15 +456,22 @@ rspamd_config.SPOOF_REPLYTO = {
-- First check for a Reply-To header
local rt = task:get_header('Reply-To')
if not rt then return false end
-- Get From header domain
local fromdom = ((task:get_from(2) or E)[1] or E).domain
if not fromdom then return false end
-- Get From and To headers
local from = task:get_from(2)
local to = task:get_recipients(2)
if not (from and from[1] and from[1].addr) then return false end
if (to and to[1] and to[1].addr) then
-- Handle common case for Web Contact forms of From = To
if util.strequal_caseless(from[1].addr, to[1].addr) then
return false
end
end
-- SMTP recipients must contain From domain
local to = task:get_recipients(1)
if not to then return false end
local found_fromdom = false
for _, t in ipairs(to) do
if util.strequal_caseless(t.domain, fromdom) then
if util.strequal_caseless(t.domain, from[1].domain) then
found_fromdom = true
break
end
@@ -474,8 +481,8 @@ rspamd_config.SPOOF_REPLYTO = {
local parsed = ((util.parse_mail_address(rt) or E)[1] or E).domain
if not parsed then return false end
-- Reply-To domain must be different to From domain
if not util.strequal_caseless(parsed, fromdom) then
return true, fromdom, parsed
if not util.strequal_caseless(parsed, from[1].domain) then
return true, from[1].domain, parsed
end
return false
end,

+ 1
- 1
rules/regexp/misc.lua Ver arquivo

@@ -41,7 +41,7 @@ reconf['DATA_URI_OBFU'] = {
}

reconf['INTRODUCTION'] = {
re = '/\\b(?:my name is\\b|(?:i am|this is)\\s+(?:mr|mrs|ms|miss|master|sir|prof(?:essor)?|d(?:octo)?r|rev(?:erend)?)(\.|\\b))/{sa_body}i',
re = '/\\b(?:my name is\\b|(?:i am|this is)\\s+(?:mr|mrs|ms|miss|master|sir|prof(?:essor)?|d(?:octo)?r|rev(?:erend)?)(?:\\.|\\b))/{sa_body}i',
description = "Sender introduces themselves",
score = 2.0,
group = 'scams'

Carregando…
Cancelar
Salvar