local h = task:get_header(arg)
if h then
local hdr_freemail = freemail_search(h)
+
if hdr_freemail > 0 and re then
- r = rspamd_regexp.create_cached(re)
+ local r = rspamd_regexp.create_cached(re)
if r then
- r:match(h)
+ if r:match(h) then
+ return 1
+ end
else
rspamd_logger.infox(rspamd_config, 'cannot create regexp %1', re)
return 0
scores[words[2]] = parse_score(words)
elseif words[1] == 'freemail_domains' then
_.each(function(dom)
- table.insert(freemail_domains, '@' .. dom)
+ table.insert(freemail_domains, '@' .. dom)
end, _.drop_n(1, words))
elseif words[1] == 'tflags' then
process_tflags(cur_rule, words)
rules[sym] = r
end
-if freemail_domains then
- freemail_trie = rspamd_trie.create(freemail_domains)
- rspamd_logger.infox(rspamd_config, 'loaded %1 freemail domains definitions',
- #freemail_domains)
-end
-
local function sa_regexp_match(data, re, raw, rule)
local res = 0
if not re then
end,
rules))
+ if freemail_domains then
+ freemail_trie = rspamd_trie.create(freemail_domains)
+ rspamd_logger.infox(rspamd_config, 'loaded %1 freemail domains definitions',
+ #freemail_domains)
+ end
end
local has_rules = false