]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Fix] external_services: register fail-only stub when configure() fails
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 25 Apr 2026 18:41:59 +0000 (19:41 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 25 Apr 2026 18:41:59 +0000 (19:41 +0100)
commitf654ec35d284d3883647eab7eda279f10cc3fc7c
treedf46b7d92f4d1242684c87889aa888db66e7c94f
parent952446f65d10d196491f3f9dd0fc735dd392865a
[Fix] external_services: register fail-only stub when configure() fails

Issue #6000: a hostname that does not resolve at startup made
add_scanner_rule() crash on a nil-deref ("rule.symbol or sym:upper()"
where rule is already nil), which disabled the whole external_services
module and silently dropped malware scans.

Resolve the symbol names from opts up-front so the error path no longer
touches the nil rule. When cfg.configure(opts) returns nil (bad type,
missing servers, etc.) build a degraded rule whose callback always
emits the configured *_FAIL symbol with reason
"<type>: configuration failed (see startup log)", so the misconfigura-
tion is visible on every scan instead of being silent.

The upstream-layer changes that follow make DNS failures no longer
land in this branch, but the stub remains the right behaviour for
genuine configure() failures.
src/plugins/lua/external_services.lua