name = 'BIMI_CHECK',
type = 'normal',
callback = bimi_callback,
+ augmentations = {string.format("timeout=%f", settings.helper_timeout or
+ redis_params.timeout or 0.0)}
})
rspamd_config:register_symbol{
name = 'BIMI_VALID',
type = 'idempotent',
flags = 'empty,explicit_disable,ignore_passthrough',
callback = callback_gen(clusterting_idempotent_cb, rule),
+ augmentations = {string.format("timeout=%f", redis_params.timeout or 0.0)}
}
end
else
callback = elastic_collect,
priority = 10,
flags = 'empty,explicit_disable,ignore_passthrough',
+ augmentations = {string.format("timeout=%f", settings.timeout)},
})
rspamd_config:add_on_load(function(cfg, ev_base,worker)
type = 'idempotent',
callback = history_save,
flags = 'empty,explicit_disable,ignore_passthrough',
- priority = 150
+ priority = 150,
+ augmentations = {string.format("timeout=%f", redis_params.timeout or 0.0)}
})
lua_redis.register_prefix(settings.key_prefix .. hostname, N,
"Redis history", {
r.defer = settings.defer
r.selector = settings.pusher_select.redis_pubsub
r.formatter = settings.pusher_format.redis_pubsub
+ r.timeout = redis_params.timeout
settings.rules[r.backend:upper()] = r
end
end
r.defer = settings.defer
r.selector = settings.pusher_select.http
r.formatter = settings.pusher_format.http
+ r.timeout = settings.timeout or 0.0
settings.rules[r.backend:upper()] = r
end
end
r.smtp_port = settings.smtp_port
r.email_template = settings.email_template
r.defer = settings.defer
+ r.timeout = settings.timeout or 0.0
r.selector = settings.pusher_select.send_mail
r.formatter = settings.pusher_format.send_mail
settings.rules[r.backend:upper()] = r
settings.rules[k] = nil
else
backend_check.default(k, rule)
+ rule.timeout = redis_params.timeout
end
end
setmetatable(backend_check, {
callback = gen_exporter(r),
priority = 10,
flags = 'empty,explicit_disable,ignore_passthrough',
+ augmentations = {string.format("timeout=%f", r.timeout or 0.0)}
})
end
type = 'normal',
callback = mx_check,
flags = 'empty',
+ augmentations = {string.format("timeout=%f", settings.timeout + rspamd_config:get_dns_timeout() or 0.0)},
})
rspamd_config:register_symbol({
name = settings.symbol_no_mx,
callback = check_p0f,
priority = 8,
flags = 'empty,nostat',
- group = N
+ group = N,
+ augmentations = {string.format("timeout=%f", rule.timeout or 0.0)},
+
})
if rule.symbol then
priority = 7,
callback = ratelimit_cb,
flags = 'empty,nostat',
+ augmentations = {string.format("timeout=%f", redis_params.timeout or 0.0)},
}
local id = rspamd_config:register_symbol(s)
name = 'RATELIMIT_UPDATE',
flags = 'explicit_disable,ignore_passthrough',
callback = ratelimit_update_cb,
+ augmentations = {string.format("timeout=%f", redis_params.timeout or 0.0)},
}
end
end
type = 'callback',
callback = rbl_callback_white,
name = 'RBL_CALLBACK_WHITE',
- flags = 'nice,empty,no_squeeze'
+ flags = 'nice,empty,no_squeeze',
+ augmentations = {string.format("timeout=%f", rspamd_config:get_dns_timeout() or 0.0)},
}
rspamd_config:register_symbol{
type = 'callback',
callback = rbl_callback_fin,
name = 'RBL_CALLBACK',
- flags = 'empty,no_squeeze'
+ flags = 'empty,no_squeeze',
+ augmentations = {string.format("timeout=%f", rspamd_config:get_dns_timeout() or 0.0)},
}
for _, w in ipairs(white_symbols) do
name = rule.symbol,
type = rule_type,
callback = callback_gen(reputation_filter_cb, rule),
+ augmentations = {string.format("timeout=%f", redis_params.timeout or 0.0)},
}
if rule.selector.config.split_symbols then
type = 'postfilter',
flags = 'nostat,explicit_disable,ignore_passthrough',
callback = callback_gen(reputation_postfilter_cb, rule),
+ augmentations = {string.format("timeout=%f", redis_params.timeout or 0.0)},
}
end
type = 'idempotent',
flags = 'explicit_disable,ignore_passthrough',
callback = callback_gen(reputation_idempotent_cb, rule),
+ augmentations = {string.format("timeout=%f", redis_params.timeout or 0.0)},
}
end
callback = gen_redis_callback(h, id),
priority = 10,
flags = 'empty,nostat',
+ augmentations = {string.format("timeout=%f", redis_params.timeout or 0.0)},
})
end, redis_key_handlers)
end
flags = 'fine,empty',
groups = {'policies','spf'},
score = 0.0,
- callback = spf_check_callback
+ callback = spf_check_callback,
+ -- We can merely estimate timeout here, as it is possible to construct an SPF record that would cause
+ -- many DNS requests. But we won't like to set the maximum value for that all the time, as
+ -- the majority of requests will typically have 1-4 subrequests
+ augmentations = {string.format("timeout=%f", rspamd_config:get_dns_timeout() * 4 or 0.0)},
}
if local_config.whitelist then
name = 'URL_REDIRECTOR_CHECK',
type = 'callback,prefilter',
callback = url_redirector_handler,
+ -- In fact, the real timeout is nested_limit * timeout...
+ augmentations = {string.format("timeout=%f", settings.timeout)}
}
if settings.redirector_symbol then