To configure Rspamd to communicate with Redis over a Unix socket using a password, you need to adjust the relevant settings in Rspamd’s configuration files. Here’s how you can proceed:
Configure Redis
Create a file under /etc/redis/local.conf with the following content:
unixsocket /var/run/redis/redis-server.sock
unixsocketperm 777
maxclients 10240
requirepass <your password>
and set permissions and owner (as root or add sudo):
# chmod 0640 /etc/redis/local.conf
# chown redis:redis /etc/redis/local.conf
Edit the file /etc/redis/redis.conf:
# include /path/to/local.conf
# include /path/to/other.conf
# include /path/to/fragments/*.conf
# Insert here
include /etc/redis/local.conf
and later
# Accept connections on the specified port, default is 6379 (IANA #815344).
# If port 0 is specified Redis will not listen on a TCP socket.
port 0
Configure Rspamd
Edit the file /etc/rspamd/local.d/redis.conf with the following content:
servers = "/var/run/redis/redis-server.sock";
password = "<your password>";
Restart services
# systemctl restart redis
# systemctl restart rspamd