Установил лицензию так:
# drweb-ctl license --GetDemo
Видна она так:
# drweb-ctl lic -d
Debug: Use ConfigD public socket "/var/run/.com.drweb.public"
Debug: ConfigD <-- SUBSCRIBE_TO_KEY
Debug: ConfigD --> KEY_NOTIFICATION
Notice: License number 149060794, expires 2022-Apr-29 20:50:49 (29 days left)
Debug: Activated: 2022-Mar-30 20:50:49
Debug: Allows start (scanner spider gate)
И тем не менее, есть проблема:
# drweb-ctl appinfo
ConfigD; 1334; RUNNING 1; Installed (ConfigD ScanEngine FileCheck Update ESAgent NetCheck HTTPD SNMPD StatD ClamD GateD MailD LookupD Antispam UrlCheck CloudD MeshD LinuxFirewall), Should run (Update HTTPD MailD), UUID: 6e9b66cb-a743-4995-8064-540b8359fff9, created: 2022-Mar-30 17:41:22
Update; 5782; RUNNING 8
HTTPD; 40421; RUNNING 3
MailD; 11122; RUNNING 7; Milter: Invalid license; Spamd: Invalid license; Rspamd: Invalid license
В логах об этом же есть:
Mar 31 01:24:51 smtp3 drweb-maild[11122]: SIGHUP received, config will be ordered from ConfigD
Mar 31 01:24:51 smtp3 drweb-maild[11122]: Milter: Invalid license
Mar 31 01:24:51 smtp3 drweb-maild[11122]: Spamd: Invalid license
Mar 31 01:24:51 smtp3 drweb-maild[11122]: Rspamd: Invalid license
Mar 31 01:24:51 smtp3 drweb-maild[11122]: MailD 11.1.13.2110182032: Ready for service
Mar 31 14:20:34 smtp3 drweb-maild[11122]: SIGHUP received, config will be ordered from ConfigD
Mar 31 14:20:34 smtp3 drweb-maild[11122]: Milter: Invalid license
Mar 31 14:20:34 smtp3 drweb-maild[11122]: Spamd: Invalid license
Mar 31 14:20:34 smtp3 drweb-maild[11122]: Rspamd: Invalid license
Mar 31 14:20:34 smtp3 drweb-maild[11122]: MailD 11.1.13.2110182032: Ready for service
Поэтому не могу настроить связку drweb-maild с MTA exim 4.94 в режиме подключаемого фильтра через интерфейс Spamd
Сокет на 127.0.0.1 просто никем не прослушивается.
Предваряя вопрос о настройках maild:
# drweb-ctl cfshow maild
MailD.LogLevel = Info
MailD.Log = Auto
MailD.ExePath = /opt/drweb.com/bin/drweb-maild
MailD.FixedSocketPath =
MailD.TemplatesDir = /var/opt/drweb.com/templates/maild
MailD.ReportLanguages = en
MailD.ReportLanguages = ru
MailD.RepackPassword = Plain(Dangerous)
MailD.TemplateContacts =
MailD.RunAsUser = drweb
MailD.DnsResolverConfPath = /etc/resolv.conf
MailD.IdleTimeLimit = 30s
MailD.SpoolDir = /tmp/com.drweb.maild
MailD.ScanTimeout = 3m
MailD.HeuristicAnalysis = On
MailD.PackerMaxLevel = 8
MailD.ArchiveMaxLevel = 8
MailD.MailMaxLevel = 8
MailD.ContainerMaxLevel = 8
MailD.MaxCompressionRatio = 500
MailD.MaxSizeToExtract = None
MailD.MilterDebugIpc = No
MailD.MilterTraceContent = No
MailD.MilterSocket = 127.0.0.1:783
MailD.MilterHook =
local dw = require "drweb"
function milter_hook(ctx)
-- Reject the message if it is likely spam
if ctx.message.spam.score >= 100 then
dw.notice("Spam score: " .. ctx.message.spam.score)
return {action = "reject"}
else
-- Assign X-Drweb-Spam headers in accordance with spam report
ctx.modifier.add_header_field("X-DrWeb-SpamScore", ctx.message.spam.score)
ctx.modifier.add_header_field("X-DrWeb-SpamState", ctx.message.spam.type)
ctx.modifier.add_header_field("X-DrWeb-SpamDetail", ctx.message.spam.reason)
ctx.modifier.add_header_field("X-DrWeb-SpamVersion", ctx.message.spam.version)
end
-- Check if the message contains viruses, repack if so
for threat, path in ctx.message.threats{category = {"known_virus", "virus_modification", "unknown_virus", "adware", "dialer"}} do
ctx.modifier.repack()
dw.notice(threat.name .. " found in " .. (ctx.message.part_at(path).name or path))
end
-- Repack if unwanted URL has been found
for url in ctx.message.urls{category = {"infection_source", "not_recommended", "owners_notice"}} do
ctx.modifier.repack()
dw.notice("URL found: " .. url .. "(" .. url.categories[1] .. ")")
end
-- Assign X-AntiVirus header
local x_antivirus = ctx.gen.x_antivirus_header_field()
if x_antivirus then
ctx.modifier.add_header_field(x_antivirus.name, x_antivirus.value)
end
-- Accept the message with all scheduled transformations applied
return {action = 'accept'}
end
MailD.SpamdDebugIpc = Yes
MailD.SpamdSocket = 127.0.0.1:10026
MailD.SpamdReportHook =
local dw = require "drweb"
function spamd_report_hook(ctx)
local score = 0
local report = ""
-- Add 1000 to the score for each threat found in the message
for threat, path in ctx.message.threats{category = {"known_virus", "virus_modification", "unknown_virus", "adware", "dialer"}} do
score = score + 1000
report = report .. "Threat found: " .. threat.name .. "\n"
dw.notice(threat.name .. " found in " .. (ctx.message.part_at(path).name or path))
end
-- Add 100 to the score for each unwanted found URL in the message
for url in ctx.message.urls{category = {"infection_source", "not_recommended", "owners_notice"}} do
score = score + 100
report = report .. "Url found: " .. url .. "\n"
dw.notice("URL found: " .. url .. "(" .. url.categories[1] .. ")")
end
-- Add the spam score
score = score + ctx.message.spam.score
report = report .. "Spam score: " .. ctx.message.spam.score .. "\n"
if ctx.message.spam.score >= 100 then
dw.notice("Spam score: " .. ctx.message.spam.score)
end
-- Return the check result
return {
score = score,
threshold = 100,
report = report
}
end
MailD.RspamdDebugIpc = No
MailD.RspamdHttpSocket =
MailD.RspamdSocket = 127.0.0.1:10027
MailD.RspamdHook =
local dw = require "drweb"
function rspamd_hook(ctx)
local score = 0
local symbols = {}
-- Add 1000 to the score for each threat found in the message
for threat, path in ctx.message.threats{category = {"known_virus", "virus_modification", "unknown_virus", "adware", "dialer"}} do
score = score + 1000
table.insert(symbols, {name = threat.name, score = 1000})
dw.notice(threat.name .. " found in " .. (ctx.message.part_at(path).name or path))
end
-- Add 100 to the score for each unwanted URL found in the message
for url in ctx.message.urls{category = {"infection_source", "not_recommended", "owners_notice"}} do
score = score + 100
table.insert(symbols, {name = "URL " .. url, score = 100})
dw.notice("URL found: " .. url .. "(" .. url.categories[1] .. ")")
end
-- Add the spam score
score = score + ctx.message.spam.score
table.insert(symbols, {name = "Spam score", score = ctx.message.spam.score})
if ctx.message.spam.score >= 100 then
dw.notice("Spam score: " .. ctx.message.spam.score)
end
-- Return the check result
return {
score = score,
threshold = 100,
symbols = symbols
}
end
MailD.SpfCheckTimeout = 20s
MailD.SpfVoidLimit = 2