Rspamd learning fault due to lacking redis connection

rspamd
mail
v7

(Guus) #1

Nethserver 7.6.1810(final)
emclient over imap and carddav (SOGo)

I also tried to get the learn funktion working with no luck. I moved junk mail from inbox to junk folder and got this bounce message:

The mail system

<“guus@ijzereef.nl+learn_spam”@spamtrain.nh>: Command died with status 1:
“/usr/bin/rspamc”. Command output: Results for file: stdin (2.017 seconds)
HTTP error: 1, error getting reply from redis server
/var/run/redis-rspamd/rspamd: No such file or directory

So I searched, found this topic and checked my log files:

imap log:
Jan 9 19:51:34 yz1web dovecot: imap(guus@ijzereef.nl): sieve: pipe action: piped message to program `spam-training’
Jan 9 19:51:34 yz1web dovecot: imap(guus@ijzereef.nl): sieve: left message in mailbox ‘Junk’

maillog:
Jan 9 19:54:41 yz1web rspamd[30096]: <>; ; rspamd_redis_pool_new_connection: cannot connect to redis: No such file or directory
Jan 9 19:54:41 yz1web rspamd[30096]: <>; ; rspamd_lua_redis_prepare_connection: cannot connect to redis: unknown error
Jan 9 19:54:41 yz1web rspamd[30096]: <>; lua; lua_redis.lua:722: cannot execute redis request

redis rspamd log:
empty file

any suggestions how to solve?


(Stéphane de Labrusse) #2

systemctl restart redis-rspamd

check if you have the socket

ll /var/run/redis-rspamd/rspamd


(Guus) #3

command gave no remark

command gives following errors:
ll /var/run/redis-rspamd/rspamd
ls: cannot access /var/run/redis-rspamd/rspamd: No such file or directory

should I reinstall redis-rspamd?

Si i tried to install package redis through yum

and now the command gives the expected response:
[root@yz1web ~]# ll /var/run/redis-rspamd/rspamd
srwxrwx— 1 redis mail 0 Jan 11 19:08 /var/run/redis-rspamd/rspamd

Start checking the learning function now.


(Stéphane de Labrusse) #4

systemctl status redis-rspamd

and any clues in /var/log/messages & /var/log/maillog


(Guus) #5

it seemed that redis was not installed


(Stéphane de Labrusse) #6

probably redis was down, or you removed it…do not know


(Guus) #7

I gues somehow i removed it. Also the epel repository wasn’t active anymore, I restored that yesterday.
Now the outcom is:

[root@yz1web ~]# systemctl status redis-rspamd
● redis-rspamd.service - Redis persistent key-value database Rspamd
Loaded: loaded (/usr/lib/systemd/system/redis-rspamd.service; static; vendor preset: disabled)
Active: active (running) since Fri 2019-01-11 19:08:23 CET; 2min 55s ago
Main PID: 11348 (redis-server)
CGroup: /system.slice/redis-rspamd.service
└─11348 /usr/bin/redis-server 127.0.0.1:0

Jan 11 19:08:23 yz1web.ijzereef.nl systemd[1]: Started Redis persistent key-value databa…d.
Hint: Some lines were ellipsized, use -l to show in full.
I say thanks, start testing the rspamd learning functionality


(Guus) #8

So the learning function of rspamd over the Junk folder works like a charme.

Do I have to make the redis server autostart? With which command if so?


(Stéphane de Labrusse) #9

auto start for redis is enabled I think, check if it is enabled

systemctl status redis

systemctl status redis-rspamd


(Guus) #10

[root@yz1web ~]# systemctl status redis
● redis.service - Redis persistent key-value database
Loaded: loaded (/usr/lib/systemd/system/redis.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/redis.service.d
└─limit.conf
Active: inactive (dead)
[root@yz1web ~]# systemctl status redis-rspamd
● redis-rspamd.service - Redis persistent key-value database Rspamd
Loaded: loaded (/usr/lib/systemd/system/redis-rspamd.service; static; vendor preset: disabled)
Active: active (running) since Fri 2019-01-11 19:08:23 CET; 15min ago
Main PID: 11348 (redis-server)
CGroup: /system.slice/redis-rspamd.service
└─11348 /usr/bin/redis-server 127.0.0.1:0

Jan 11 19:08:23 yz1web.ijzereef.nl systemd[1]: Started Redis persistent key-value databa…d.
Hint: Some lines were ellipsized, use -l to show in full.

So all seems well, many thanks.


(Stéphane de Labrusse) #11

yep same output on myserver, it seems good. If you matter you should investigate why redis was removed from your server.


(Guus) #12

Only thing I can think of is that because it wasn’t working i decided to remove rspamd an reinstall it again. Probably this also removed redis and because the epel repository wasn’t active the new installation of rspamd couldn’t install redis.

Question then offcourse is why and how the epel repository was removed. I can’t remember anything causing this but it must have been some action from my site.