Saturday, March 26, 2005

Installing SpamAssassin 3.0.2 on OpenBSD 3.6

SpamAssassinSpamAssassin is an open-source spam filter. The package/port shipping for OPENBSD_3_6_BASE (what's on your CD... you bought a CD, right?) is an older version of SpamAssassin.

The version of SpamAssassin that is included with OpenBSD-current (OpenBSD 3.7-beta) compiles and installs cleanly on OpenBSD 3.6.

Notes: I'm logged in as a non-priviledged user who is a member of wheel. Wheel is allowed to run any command with sudo. Also, my user is a member of the wsrc group. Finally, my /etc/mk.conf contains "SUDO=/usr/bin/sudo".


  1. Set CVSROOT to your favorite CVS mirror.

  2. If necessary, create a build directory: sudo mkdir -p /usr/local/ports ; sudo chgrp wsrc /usr/local/ports ; chmod 775 /usr/local/ports

  3. Change to a directory above your build directory: cd /usr/local

  4. Get the code: cvs -d $CVSROOT get ports/mail/p5-Mail-SpamAssassin

  5. Change to the clamav directory: cd ports/mail/p5-Mail-SpamAssassin

  6. Build the port in the usual way: make install



If you're going to use SpamAssassin's spamd:

  1. Create spamd group: sudo groupadd -g 506 _spamdaemon

  2. Create spamd user: sudo useradd -g _spamdaemon -d /nonexistent -L daemon -c 'SpamAssassin Daemon' -s /sbin/nologin -u 506 _spamdaemon

  3. Create spamassassin working directory: sudo mkdir -p -m 700 /var/spool/spamassassin

  4. Change ownership of working directory: sudo chown _spamdaemon:_spamdaemon /var/spool/spamassassin

  5. Edit your /etc/rc.conf.local file with: spamassassin_daemon="-c -m 10 -H"

  6. Edit your /etc/rc.local file with:

    if [ -x /usr/local/bin/spamd -a X"${spamassassin_daemon}" != X"NO" ]; then
    echo -n ' SpamAssassin'
    /usr/local/bin/spamd -d -r /var/spool/spamassassin/spamd.pid \
    -u _spamdaemon ${spamassassin_daemon}
    fi

  7. Finally, either reboot or start spamd with the options from rc.conf.local and rc.local.



Edit (January 17, 2006 @ 10:47 AM): Fixed variable mistake above. Changed {$spamassassin_daemon} to ${spamassassin_daemon}. Thanks, Dave.

No comments:

Post a Comment