Innovate | Connect | Transform
ContactService statusUSD $

GICT knowledge base

Install rspamd and redis on DirectAdmin

Published

DirectAdminrspamd

For those using DirectAdmin, Rspamd is a modern, blazing-fast anti-spam system that easily outperforms the older SpamAssassin.

In the past, setting this up required manually installing Redis through your operating system. However, DirectAdmin has updated CustomBuild to fully support native Redis installations. This makes pairing Redis and Rspamd much cleaner, as you can manage everything directly through DirectAdmin’s built-in tools.

Here is the updated, streamlined way to get Redis and Rspamd up and running smoothly on your server.

Step 1: Install Redis via CustomBuild

Instead of using OS packages, we will use DirectAdmin’s CustomBuild to install and configure Redis automatically. Run the following commands:

da build update
da build set redis yes
da build redis

Step 2: Install Rspamd via CustomBuild

Now that Redis is running in the background, we will configure your mail server to use Rspamd as its primary spam filter. Run the following commands to swap out SpamAssassin for Rspamd:

da build set eximconf yes
da build set eximconf_release 4.5
da build set blockcracking yes
da build set easy_spam_fighter yes
da build set spamd rspamd
da build set exim yes
da build exim
da build set dovecot_conf yes
da build dovecot_conf
da build rspamd
da build exim_conf

Step 3: Connect Rspamd to Redis

Even though both are installed, we need to explicitly tell Rspamd where to find the Redis database so it can cache your spam filtering rules. By default, DirectAdmin sets up Redis to listen on the local port 6379.

Create a new file at /etc/rspamd/local.d/redis.conf and add this single line:

servers = "127.0.0.1:6379";

Step 4: Verify and Restart

Before putting everything to work, verify the configuration syntax to ensure there are no typos. Run the configuration test and then restart the Rspamd service:

rspamadm configtest
systemctl restart rspamd

If the test returns “syntax OK”, Rspamd is officially enabled and actively filtering your server’s email!

Taking It Further

To make your filtering even more aggressive, consider adding additional custom rules from MailBaby at https://github.com/mailbaby/rspamd-rules.If you want to ensure Rspamd is automatically enabled whenever you create a new hosting account, check out DirectAdmin’s official guide. That same link will also show you the quick command to enable Rspamd retroactively on all of your existing accounts.

Related guides

Account services are unavailable until the production backend is configured.