diff options
author | laodc <github@laodc.com> | 2023-08-21 15:45:58 +0700 |
---|---|---|
committer | laodc <github@laodc.com> | 2023-08-21 15:45:58 +0700 |
commit | 75fdc829bacbdc767b20d3f0e40b91215fce14fe (patch) | |
tree | 209d8d53e71cd5a92deb69fcb740bb2649bb66ee /src/plugins/lua/bimi.lua | |
parent | 1931487b17059d6c63adf2245c9632384657f89e (diff) | |
download | rspamd-75fdc829bacbdc767b20d3f0e40b91215fce14fe.tar.gz rspamd-75fdc829bacbdc767b20d3f0e40b91215fce14fe.zip |
Added support for Redis 6 ACL (username/password)
Diffstat (limited to 'src/plugins/lua/bimi.lua')
-rw-r--r-- | src/plugins/lua/bimi.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/lua/bimi.lua b/src/plugins/lua/bimi.lua index 914484543..5053cc941 100644 --- a/src/plugins/lua/bimi.lua +++ b/src/plugins/lua/bimi.lua @@ -263,7 +263,14 @@ local function check_bimi_vmc(task, domain, record) if redis_params.db then db = string.format('/%s', redis_params.db) end - if redis_params.password then + if redis_params.username then + if redis_params.password then + password = string.format( '%s:%s@', redis_params.username, redis_params.password) + else + rspamd_logger.errx(task, "Redis requires a password when username is supplied") + return + end + elseif redis_params.password then password = string.format(':%s@', redis_params.password) end local redis_server = string.format('redis://%s%s:%s%s', |