Rspamd, the fast, free and open-source spam filtering system, goes with a web interface, which provides basic functions for setting metric actions, scores, viewing statistic and learning. Here is a guide on how to get installed into DirectAdmin control panel on admin level.
Rspamd is an advanced spam filtering system that allows evaluation of messages by a number ;
of rules including regular expressions, statistical analysis and custom services such as URL black lists.
If you want to install Rspamd on CentOS 8 with DirectAdmin, here is a short guide on the matter.
At the moment of the publication CentOS 8 repo is added for Rspamd experimental builds. There are no plans to add CentOS 8 support for 1.9.4, as claims the Rspamd author. So let's go and install it!
First make sure you've got CentOS 8 installed, run the command:
for this. You should see something like:
CentOS Linux release 8.0.1905 (Core)
It's expected to see CentOS Linux release 8 here. The other numbers might differ at the moment of a reading.
As root run the following command:
wget https://rspamd.com/rpm/centos-8/rspamd-experimental.repo -O /etc/yum.repos.d/rspamd.repo
So, here we downloaded a file with information about Rspamd repository and installed it. The next step will be to install Rspamd.
We will use CustomBuild to get Rspamd installed and configured for our needs:
cd /usr/local/directadmin/custombuild/ ./build update ./build set spamd rspamd ./build rspamd
The final command is expected to give a similar output to the following one:
Complete! Enabling rspamd in systemd... Disabling spamassassin in systemd... Removed /etc/systemd/system/multi-user.target.wants/spamassassin.service. Removed /etc/systemd/system/spamd.service. Removing directory: /var/lib/spamassassin... Removing directory: /usr/share/perl5/Mail/SpamAssassin... Removing directory: /usr/lib64/perl5/auto/Mail/SpamAssassin... Removing directory: /usr/share/spamassassin... Removing directory: /etc/mail/spamassassin... Removing directory: /root/.spamassassin... Removing file: /usr/bin/spamassassin... Removing file: /usr/bin/sa-check_spamd... Removing file: /usr/bin/spamc... Removing file: /usr/bin/sa-learn... Removing file: /usr/bin/spamd... Removing file: /usr/bin/sa-awl... Removing file: /usr/bin/sa-update... Removing file: /usr/bin/sa-compile... Removing file: /etc/exim.spamassassin.conf... Removing file: /etc/cron.daily/sa-update... SpamAssassin has been successfully removed Debug mode. Level 10 dataskq: command: action=rewrite&value=rspamd Spam::write_spamd_conf: user_prefs for wp7test is not enabled. Skipping this write. Restarting rspamd. Restarting exim.
So, Rspamd is installed! Need to do some additional tweaks:
Make sure outgoing connections to remote UDP port 11335 are allowed. If blocked you will see an error:
got error on IO with server fuzzy1.rspamd.com:11335(188.8.131.52:11335), on write, 1, Operation not permitted
If you use CSF/LFD just add the port into UDP_OUT and UDP6_OUT, then restart csf.
The Rspamd 2.0 moved to use redis as a backend, if it's not what you want you might need to roll back to sqlite, for this do the following.
Create a file /etc/rspamd/local.d/statistic.conf:
And now either open the file in an editor and populate with a content from the link at github or use the following command:
wget -O /etc/rspamd/local.d/statistic.conf https://raw.githubusercontent.com/poralix/directadmin-utils/master/rspamd/rspamd2-statistic-sqlite.conf
to install the needed config.
Then restart Rspamd:
systemctl restart rspamd
and check to make sure it's running:
[root@server rspamd]# ps aux | grep rspamd _rspamd 568 4.1 1.7 180324 69620 ? Ss 01:35 0:00 rspamd: main process _rspamd 571 0.0 1.4 180324 56812 ? S 01:35 0:00 rspamd: rspamd_proxy process (localhost:11332) _rspamd 574 0.0 1.5 181464 58776 ? S 01:35 0:00 rspamd: controller process (localhost:11334) _rspamd 575 0.0 1.4 180684 58016 ? S 01:35 0:00 rspamd: normal process (localhost:11333) _rspamd 577 0.0 1.4 180324 56068 ? S 01:35 0:00 rspamd: hs_helper process root 580 0.0 0.0 10024 948 pts/1 R+ 01:35 0:00 grep --color=auto rspamd root 23030 0.0 0.0 166428 812 ? Ss 00:01 0:00 gpg-agent --homedir /var/cache/dnf/rspamd-experimental-9db1f43f1540b7c6/pubring --use-standard-socket --daemon [root@server rspamd]#
You can install Rspamd plugin for DirectAdmin. It will add Rspamd WebUI into DirectAdmin at admin level