Implement spam protection with Rspamd

Setup (Postfix)

Install

apt update
apt install rspamd redis-server

systemctl enable --now rspamd redis

Configure Postfix to use Rspamd via Milter

vi /etc/postfix/main.cf

smtpd_milters = inet:localhost:11332
non_smtpd_milters = $smtpd_milters
milter_protocol = 6
milter_default_action = accept

Enable Rspamd Web UI

rspamadm pw     # Gen hashkey

vi /etc/rspamd/local.d/worker-controller.inc
bind_socket = "192.168.23.8:11334";
password = "hashkey";

Browser: http://192.168.23.8:11334

Set score thresholds

vi /etc/rspamd/local.d/actions.conf

actions {
    reject = 15.0;
    add_header = 6.0;
    greylist = 4.0;
}

Configure Redis

vi /etc/rspamd/local.d/redis.conf

# Redis connection for statistics and caching
servers = "127.0.0.1:6379";


systemctl restart rspamd

DKIM

rspamadm configwizard