FreeBSD SpamAssassin

From MediaWiki
Jump to: navigation, search

Contents

Overview

SpamAssassin is a highly effiicient opensource spam filtering software for UNIX. One way of using SA is to configure procmail to call spamassassin directly while pulling down mail with a tool like [fetchmail]. In FreeBSD, you could setup SA as below.

Install From Ports

[buffy] ~> cat /var/db/ports/p5-Mail-SpamAssassin/options
# This file is auto-generated by 'make config'.
# No user-servicable parts inside!
# Options for p5-Mail-SpamAssassin-3.2.3
_OPTIONS_READ=p5-Mail-SpamAssassin-3.2.3
WITH_AS_ROOT=true
WITH_SPAMC=true
WITHOUT_SACOMPILE=true
WITH_DKIM=true
WITH_SSL=true
WITH_GNUPG=true
WITHOUT_MYSQL=true
WITHOUT_PGSQL=true
WITH_RAZOR=true
WITHOUT_SPF_QUERY=true
WITHOUT_RELAY_COUNTRY=true


Starting SpamAssassin

[buffy] ~> grep spam /etc/rc.conf.local
spamd_enable="YES"
spamd_flags="-s /var/log/spamd.log"
[buffy] ~> sudo /usr/local/etc/rc.d/sa-spamd.sh start
[buffy] ~> ps ax|grep spamd
56658  ??  Ss     0:00.64 /usr/local/bin/spamd -c -d -r /var/run/spamd/spamd.pid (perl5.8.6)
56837  ??  S      0:08.46 spamd child (perl5.8.6)
56838  ??  S      0:07.50 spamd child (perl5.8.6)
56839  ??  S      2:32.61 spamd child (perl5.8.6)
56840  ??  S      2:30.63 spamd child (perl5.8.6)
56841  ??  S      5:50.84 spamd child (perl5.8.6)

Update .procmailrc

There are two ways to call SpamAssassin - /usr/local/bin/spamassassin or via /usr/local/bin/spamc.

spamc is the client for spamd (which we started earlier). If you dont have spamd running, then call spamassassin direclty. I prefer to use spamd for effciency reasons as I deal with a large volume of mail.

# use the spamassassin client
:0fw: spamassassin.lock
| /usr/local/bin/spamc
:0 * ^X-Spam-Flag: YES .spam/

See procmail and spamassassin

Update .muttrc

See Mutt

Personal tools