Longer history in rspamd possible?

Greetings all, I realize I was away for quite some time, but this is also good as it shows - besides that I am quite loaded with daily business - that our neth- and proxmox-servers work seemless like a swiss clockwork :blush:

I have a question regarding the rspamd webinterface history. I realized that the history does “only” go back to 80 pages, which in our case means two weeks. Is there a way to increase this so we can show ex. blocked mails for a longer period like 2 or 3 months?

@stephdl your spell is needed :slight_smile:

2 Likes

I think no for the UI of rspamd, at least I do not know and I think since the data is stored to redis (the database) then maybe they purge it from time to time.

But the logrotate is (normally) set to 52 weeks, so you keep one year of log and you know about any score of emails, accepted or rejected.

[root@prometheus ~]# config show logrotate 
logrotate=configuration
    Compression=disabled
    Rotate=weekly
    Times=52

Mhm, I first thought this could help, but maybe it is only possible by patching some lua file, which I don’t think is a good idea?!

Patching files won’t survive the next rspamd update but maybe the nrow prop could be increased because we have enabled this plugin.

Not sure but it might be tested

2 Likes

Does that mean that this increase could be made retrospective, or is the data longer than two months ago in our case gone?

Please let me know if I can be of help testing. But I would need advice on what to modify and how to test. Happy to help you help us :blush:

Can someone please explain to me, how long those history entries are and where they are defined? Is it defined by date (older than
) or by number of entries?

you can change there but this change will be overwritten by the next nethserver-mail-filter

by another hand you can like the top of the file suggest

create a file : /etc/rspamd/override.d/history_redis.conf then add

# Custom rows limit (default is 2000)
nrows = 20000;

restart rspamd

systemctl restart rspamd

verify rspamd check the good value

[root@prometheus ~]# rspamadm configdump | grep 'nrows'
    nrows = 20000;

just tested it it works, the default value is 200 I increased it to 2000 when I did the module, now I set it to 20000 on my personal server but the redis db will grow obviously

1 Like

Thank you, I will try that. Is it correct, that this cannot be done retrospective as the redis db is stored in ram only? So it will now start create longer history, but the data longer than 2 months ago in our case are cannot be shown in the history, right?

it is not a time value but a number of rows you store in a database key. So in that case you purge when you hit the maximum of 2000 rows, indeed what it has not been stored before or purged is not anymore in the redis database (redis has to write to your drive to be persistent)

[root@prometheus ~]# ll /var/lib/redis/rspamd/dump.rdb
-rw-r--r-- 1 redis mail 10973377 Nov  5 11:10 /var/lib/redis/rspamd/dump.rdb
1 Like

Just for the record, I opted to go for 6000 to moderately grow the db while extending the history.

And once more - I just have to admit that you guys rock. Please keep up the good work and the great community support that is unsurpassable.

2 Likes