|
|
@ -12,7 +12,7 @@ distributed under the License is distributed on an "AS IS" BASIS, |
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
|
|
See the License for the specific language governing permissions and |
|
|
|
limitations under the License. |
|
|
|
]]-- |
|
|
|
]] -- |
|
|
|
|
|
|
|
local util = require "rspamd_util" |
|
|
|
local ipairs = ipairs |
|
|
@ -1158,7 +1158,7 @@ local function is_8bit_addr(addr) |
|
|
|
return false; |
|
|
|
end |
|
|
|
|
|
|
|
rspamd_config.INVALID_FROM_8BIT = { |
|
|
|
local invalid_from_8bit = { |
|
|
|
callback = function(task) |
|
|
|
local from = (task:get_from('mime') or {})[1] or {} |
|
|
|
if is_8bit_addr(from) then |
|
|
@ -1171,7 +1171,7 @@ rspamd_config.INVALID_FROM_8BIT = { |
|
|
|
group = 'headers' |
|
|
|
} |
|
|
|
|
|
|
|
rspamd_config.INVALID_RCPT_8BIT = { |
|
|
|
local invalid_rcpt_8bit = { |
|
|
|
callback = function(task) |
|
|
|
local rcpts = task:get_recipients('mime') or {} |
|
|
|
return fun.any(function(rcpt) |
|
|
@ -1188,14 +1188,17 @@ rspamd_config.INVALID_RCPT_8BIT = { |
|
|
|
|
|
|
|
if rspamd_config:is_mime_utf8() then |
|
|
|
-- Disable some of the rules preserving the underlying logic |
|
|
|
rspamd_config.INVALID_FROM_8BIT.condition = function() |
|
|
|
invalid_from_8bit.condition = function() |
|
|
|
return false |
|
|
|
end |
|
|
|
rspamd_config.INVALID_RCPT_8BIT.condition = function() |
|
|
|
invalid_rcpt_8bit.condition = function() |
|
|
|
return false |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
rspamd_config.INVALID_FROM_8BIT = invalid_from_8bit |
|
|
|
rspamd_config.INVALID_RCPT_8BIT = invalid_rcpt_8bit |
|
|
|
|
|
|
|
rspamd_config.XM_CASE = { |
|
|
|
callback = function(task) |
|
|
|
return task:has_header('X-mailer', true) |
|
|
|