This repository has been archived on 2024-07-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
etckeeper/rspamd/rspamd.local.lua
2024-03-06 09:26:05 +01:00

65 lines
1.2 KiB
Lua

## language filter
local ok_langs = {
['de'] = true,
['en'] = true,
}
rspamd_config.LANG_FILTER = {
callback = function(task)
local any_ok = false
local parts = task:get_text_parts() or {}
local ln
for _,p in ipairs(parts) do
ln = p:get_language() or ''
local dash = ln:find('-')
if dash then
-- from zh-cn to zh
ln = ln:sub(1, dash-1)
end
if ok_langs[ln] then
any_ok = true
break
end
end
if any_ok or not ln or #ln == 0 then
return false
end
return 1.0,ln
end,
score = 2.0,
description = 'no ok languages',
}
local cnf = config['regexp']
cnf['SUBJECT_CRYPTOBOT'] = {
re = 'Subject=/.*(crypto|auto|trader|new)bot.*/i{header}',
score = 1.0,
}
cnf['BODY_CRYPTOBOT'] = {
re = '/.*(crypto|auto|trader|new)bot.*/i{mime}',
score = 1.0,
}
cnf['RECEIVED_BITCOIN'] = {
re = 'Subject=/.*0.7495.*(Bitcoin|BTC).*/i{header}',
score = 1.0,
}
cnf['FROM_COINBASE'] = {
re = 'From=/.*coinbase.*/i{header}',
score = 1.0,
}
cnf['BODY_COINBASE'] = {
re = '/.*coinbase.*/i{mime}',
score = 1.0,
}
cnf['BODY_BITCOIN'] = {
re = '/.*bitcoin.*/i{mime}',
score = 1.0,
}