瀏覽代碼

Merge 94b74c48e4 into c8f3600c70

pull/4948/merge
mykeenu 3 週之前
父節點
當前提交
a44edfc65c
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 11 行新增2 行删除
  1. 11
    2
      lualib/lua_scanners/pyzor.lua

+ 11
- 2
lualib/lua_scanners/pyzor.lua 查看文件

@@ -43,6 +43,8 @@ local function pyzor_config(opts)
message = '${SCANNER}: Pyzor bulk message found: "${VIRUS}"',
default_score = 1.5,
action = false,
min_threshold = 0, -- zero score if whitelist+report count smaller than this
halfscore_threshold = 0, -- half score if whitelist+report count smaller than this
}

pyzor_conf = lua_util.override_defaults(pyzor_conf, opts)
@@ -149,8 +151,15 @@ local function pyzor_check(task, content, digest, rule)
rule.default_score: 1
Weight: 0
]]
local weight = tonumber(string.format("%.2f",
rule.default_score * (reported - whitelisted) / (reported + whitelisted)))
local weight = 0
local total = reported + whitelisted
if total > rule.min_threshold and total > 0 then
weight = tonumber(string.format("%.2f",
rule.default_score * (reported - whitelisted) / total))
if total < rule.halfscore_threshold then
weight = tonumber(string.format("%.2f", weight / 2))
end
end
local info = string.format("count=%d wl=%d", reported, whitelisted)
local threat_string = string.format("bl_%d_wl_%d",
reported, whitelisted)

Loading…
取消
儲存