return function(task)
local symbols_disabled = task:cache_get('squeezed_disable')
for _,data in ipairs(squeezed_rules[order]) do
-
if not symbols_disabled or not symbols_disabled[data[2]] then
local ret = {data[1](task)}
if not squeeze_function_ids[1] then
squeeze_function_ids[1] = rspamd_config:register_symbol{
type = 'callback',
+ flags = 'squeezed',
callback = gen_lua_squeeze_function(1),
name = squeeze_sym,
description = 'Meta rule for Lua rules that can be squeezed',
squeeze_function_ids[order] = rspamd_config:register_symbol{
type = 'callback',
+ flags = 'squeezed',
callback = gen_lua_squeeze_function(order),
name = ord_sym,
description = 'Meta rule for Lua rules that can be squeezed, order ' .. tostring(order),
setbit (checkpoint->processed_bits, item->id * 2);
if (!item->enabled ||
- (item->type & SYMBOL_TYPE_SQUEEZED) ||
(RSPAMD_TASK_IS_EMPTY (task) && !(item->type & SYMBOL_TYPE_EMPTY))) {
check = FALSE;
}
/* Set executed and finished flags */
item = g_ptr_array_index (cache->items_by_id, id);
- setbit (checkpoint->processed_bits, item->id * 2);
- setbit (checkpoint->processed_bits, item->id * 2 + 1);
+ if (!(item->type & SYMBOL_TYPE_SQUEEZED)) {
+ setbit (checkpoint->processed_bits, item->id * 2);
+ setbit (checkpoint->processed_bits, item->id * 2 + 1);
- msg_debug_task ("disable execution of %s", symbol);
+ msg_debug_task ("disable execution of %s", symbol);
+ }
+ else {
+ msg_debug_task ("skip squeezed symbol %s", symbol);
+ }
}
else {
msg_info_task ("cannot disable %s: not found", symbol);