Part 1 is available here.
First off we’ll get SpamAssassin installed and configured.
sudo apt-get install spamassassin
We’ll be configuring SpamAssassin as a daemon that Postfix interfaces with using spamc.
SpamAssassin on Debian and Ubuntu runs as root which is NOT a good thing so we’ll need to make some changes.
We’ll add a group called spamd with GID**5001**.
sudo groupadd -g 5001 spamd
Next we add a user spamd with UID 5001 and add it to the spamd group, as well as set it’s home directory as /var/lib/spamassassin and make sure it has no shell access or SSH access.
sudo useradd -u 5001 -g spamd -s /usr/sbin/nologin -d /var/lib/spamassassin spamd