Here is a brief how-to on installing the DCC plugin to reduce spam when self-hosting mail on Ubuntu 22.04 LTS.
Background reading :
- Get the latest DCC source code and unzip it
sudo -i # unsafe, poor practice on my part
apt-get install ncompress
wget https://www.dcc-servers.net/dcc/source/dcc.tar.Z
tar xvfZ dcc.tar.Z
- Create a dcc user for it to run under
adduser --system --group --no-create-home --disabled-password --disabled-login dcc
- Run autoconf and get ready for compile
cd dcc-2.3.168
CFLAGS="-O2 -fstack-protector" DCC_CFLAGS="-O2 -fstack-protector" \
./configure --disable-sys-inst --disable-dccm \
--homedir=/var/lib/dcc --bindir=/usr/local/bin --with-uid=dcc
- Compile It
CFLAGS="-O2 -fstack-protector" DCC_CFLAGS="-O2 -fstack-protector" \
make -j2
- If that worked, install it
make install
- Edit
/etc/spamassassin/local.cf
and add
local.cf:dcc_path /usr/local/bin/dccproc
local.cf:dcc_home /var/lib/dcc
- Edit
/etc/spamassassin/v310.pre
and uncomment
loadplugin Mail::SpamAssassin::Plugin::DCC
- Reload and check
systemctl restart spamassassin.service
less /var/log/syslog
less /var/log/mail.log
Hint, you can hit G
in less
to get to the bottom and f
to go into “tail” mode. Ctrl-C to exit so you can scroll up. Check these for a while to make sure there are no errors.