-- Check dkim and spf symbols
local spf_ok = false
local dkim_ok = false
- if task:get_symbol(symbols['spf_allow_symbol']) then
+ if task:has_symbol(symbols['spf_allow_symbol']) then
efrom = task:get_from(1)
if efrom and efrom[1] and efrom[1]['domain'] then
if efrom[1]['domain'] == from[1]['domain'] then
local fann_input = {}
for sym,idx in pairs(symbols) do
- if task:get_symbol(sym) then
+ if task:has_symbol(sym) then
fann_input[idx + 1] = 1
else
fann_input[idx + 1] = 0
return res
elseif external_deps[atom] then
local res = 0
- if task:get_symbol(atom) then
+ if task:has_symbol(atom) then
res = 1
end
rspamd_logger.debugx(task, 'external atom: %1, result: %2', atom, res)
local meta_cb = function(task)
local res = 0
-- XXX: need to memoize result for better performance
- local sym = task:get_symbol(k)
+ local sym = task:has_symbol(k)
if not sym then
if expression then
res = expression:process(task)
if found then
if rule['valid_spf'] then
-- Check for spf symbol
- if not task:get_symbol(options['spf_allow_symbol']) then
+ if not task:has_symbol(options['spf_allow_symbol']) then
found = false
rspamd_logger.debugx(task, "domain %s has been found in whitelist %s" ..
" but it doesn't have valid SPF record", domain, symbol)
end
end
if rule['valid_dmarc'] then
- if not task:get_symbol(options['dmarc_allow_symbol']) then
+ if not task:has_symbol(options['dmarc_allow_symbol']) then
found = false
rspamd_logger.debugx(task, "domain %s has been found in whitelist %s" ..
" but it doesn't have valid DMARC", domain, symbol)