From: Alexander Moisseev Date: Fri, 10 Apr 2026 11:31:48 +0000 (+0300) Subject: [Fix] Propagate redis_timeout into nested greylist.redis{} block X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5977%2Fhead;p=thirdparty%2Frspamd.git [Fix] Propagate redis_timeout into nested greylist.redis{} block When Redis is configured via greylist { redis { ... } }, parse_redis_server reads opts.redis and ignores opts.timeout, so redis_timeout had no effect. Shallow-copy the nested redis subtable and set its timeout when not explicitly configured by the operator. --- diff --git a/src/plugins/lua/greylist.lua b/src/plugins/lua/greylist.lua index d9badcd502..cdfacd6891 100644 --- a/src/plugins/lua/greylist.lua +++ b/src/plugins/lua/greylist.lua @@ -574,6 +574,14 @@ if opts then -- enrich_defaults since settings.redis_timeout equals lua_redis's default_timeout (1.0). local redis_opts = lua_util.shallowcopy(opts) redis_opts.timeout = settings.redis_timeout + if redis_opts.redis then + -- When Redis is configured in a nested greylist.redis{} block, parse_redis_server + -- uses opts.redis and never reads opts.timeout, so propagate redis_timeout there too. + redis_opts.redis = lua_util.shallowcopy(redis_opts.redis) + if not redis_opts.redis.timeout then + redis_opts.redis.timeout = settings.redis_timeout + end + end redis_params = lua_redis.parse_redis_server(N, redis_opts) if not redis_params then rspamd_logger.infox(rspamd_config, 'no servers are specified, disabling module')