瀏覽代碼

[Minor] Disable ONCE_RECEIVED for local networks

tags/1.4.0
Alexander Moisseev 7 年之前
父節點
當前提交
0057d84357
共有 1 個檔案被更改,包括 7 行新增12 行删除
  1. 7
    12
      src/plugins/lua/once_received.lua

+ 7
- 12
src/plugins/lua/once_received.lua 查看文件

@@ -59,23 +59,18 @@ local function check_quantity_received (task)
end
end

if task:get_user() ~= nil then
local task_ip = task:get_ip()

if task:get_user() or (task_ip and task_ip:is_local()) then
return
end

if whitelist then
local addr = task:get_from_ip()

if addr and whitelist:get_key(addr) then
rspamd_logger.infox(task, 'whitelisted mail from %s',
addr:to_string())
return
end
if whitelist and task_ip and whitelist:get_key(task_ip) then
rspamd_logger.infox(task, 'whitelisted mail from %s',
task_ip:to_string())
return
end

local task_ip = task:get_ip()
local hn = task:get_hostname()

-- Here we don't care about received
if (not hn or hn == 'unknown') and task_ip and task_ip:is_valid() then
task:get_resolver():resolve_ptr({task = task,

Loading…
取消
儲存