Saturday, March 26, 2005

Site-side SpamAssassin for OpenBSD 3.6

SpamAssassinSpamAssassin is an open-source spam filter. It uses a variety of tests to determine if an email message is SPAM or not. If determined SPAM, it can change the subject and the header of the message so that your mail program can move the message to a different folder (clearing up your Inbox).

For, I do not use a site-wide configuration, but in other SpamAssassin installations I maintain, I do. Here's how to set up SpamAssassin in a site-wide configuration 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. Install p5-Mail-SpamAssassin and its prerequisites. Alternatively, you can install SpamAssassin 3.0.2 from -current ports.

  2. Download and install my spamass-milter port.

  3. Follow the directions in the post-install message adding the appropriate commands to your /etc/rc.conf.local and /etc/rc.conf.

  4. The next part assumes that you have not modified your /etc/mail/ copy the OpenBSD prototype mc file: sudo cp /usr/share/sendmail/cf/ /etc/mail

  5. Download my patchfile to your home directory: sendmail-milter-spamass.patch

  6. Change to the mail directory: cd /etc/mail

  7. Apply my patch: patch -p0 < ~/sendmail-milter-spamass.patch

  8. Create new m4 /etc/mail/ > ~/

  9. Copy new to /etc/mail: sudo cp ~/ /etc/mail ; rm ~/
  10. Add the following line to your /etc/rc.conf.local file: sendmail_flags="-L sm-mta -bd -q30m"

  11. Either reboot or manually launch spamass-milter with the options you used in your /etc/rc.conf.local file and run: /usr/sbin/sendmail -L sm-mta -bd -q30m

Note: If you are also using ClamAV's Milter, you should substitute my sendmail-milter-clamav-spamass.patch instead of my sendmail-milter-spamass.patch.