SpamAssassin
Blugh, very mucky install - installed some xorg stuff for whatever reason…
Channel rules are stored here:
/usr/local/share/spamassassin
and the channel config files are stored here:
/var/db/spamassassin/3.002003/
Procedure
Install SpamAssassin:
# cd /usr/ports/mail/p5-Mail-SpamAssassin
# make install clean
I had to run make install a second time because it errored out the first time through - it completed the second time
-
Now create an auto-update script:
#!/usr/local/bin/bash
#
SAUP=/usr/local/bin/sa-update
$SAUP --gpgkey D1C035168C1EBC08464946DA258CDB3ABDE9DC10 --channel saupdates.openprotect.com --channel updates.spamassassin.org -D
And run the above script - make sure it completes without errors.
Add the above script to
/etc/crontab
:
# SpamAssassin Rule Updater
45 6 * * * root /root/scripts/spam-update/sa-auto-update.sh
Now SpamAssassin's rules are fully updated, so we enable SpamAssassin in
/etc/rc.conf
:
# SpamAssassin
spamd_enable="YES"
Procmail Setup: add the following to
/usr/local/etc/procmailrc
:
:0fw: spamc.lock
* < 256000
| spamc
# filter 5-star spam and greater
:0:
* ^X-Spam-Level: \*\*\*\*\*
spam
# Work around procmail bug: any output on stderr will cause the "F" in "From"
# to be dropped. This will re-add it.
:0
* ^^rom[ ]
{
LOG="*** Dropped F off From_ header! Fixing up. "
:0 fhw
| sed -e '1s/^/F/'
}
Finally, start the SpamAssassin
spamd
daemon:
# /usr/local/etc/rc.d/sa-spamd start
List of installed packages
-
p5-IO-Zlib-1.05
-
p5-IO-Compress-Zlib-2.005
p5-Compress-Zlib-2.005
p5-Mail-Tools-1.74
p5-libwww-5.805
p5-Archive-Tar-1.34
p5-Encode-Detect-1.00
p5-IO-Socket-SSL-1.08
gnupg-2.0.4
razor-agents-2.84
re2c-0.12.1
p5-Net-IP-1.25
p5-Digest-HMAC-1.01
-
-
p5-Test-Simple-0.70
p5-Compress-Raw-Zlib-2.005
p5-IO-Compress-Base-2.005
p5-Digest-MD5-2.36
p5-MIME-Base64-3.07
p5-Net-1.22,1
p5-PathTools-3.25
p5-IO-String-1.08
p5-Module-Build-0.28.08
p5-Net-SSLeay-1.30_1
libassuan-1.0.3
libgcrypt-1.2.4_1
libgpg-error-1.5
libksba-1.0.1_1
pth-2.0.7
openldap-client-2.3.38
dirmngr-0.9.7_2
p5-Digest-SHA1-2.11
p5-Math-BigInt-1.86
p5-Test-Harness-2.64
p5-Digest-1.15
p5-Authen-SASL-2.10_1
p5-Scalar-List-Utils-1.19,1
p5-ExtUtils-CBuilder-0.19
p5-ExtUtils-ParseXS-2.18
p5-YAML-0.65
p5-GSSAPI-0.24
p5-Test-Base-0.54
p5-Spiffy-0.30
p5-Mail-SpamAssassin-3.2.3
Reference Links