Categories
Applications Linux

Integrating SpamAssassin with qmail: Part 1

This is a series of articles covering integration of SpamAssassin with qmail on a Linux box.

Part 1: Installing and Configuring SpamAssassin
Part 2: Marking email as spam

Part 1: Installing and Configuring SpamAssassin

There are quite a few numbers of HOWTOs at the internet about installing the software itself. So I won’t go very much into details but rather point you to some locations where you can find sufficient information.

You’ll find the latest software package at Apache’s SpamAssassin Homepage. Unpack the archive, preferrably at /usr/local/src. It will produce a directory Mail-SpamAssassin-XXXX. Change into that directory and read the INSTALL file to learn about special features when building the spam recognition tool. Usually you need to issue three commands:

perl Makefile.PL
make
make install

That’s it. Be aware that you might need to enhance your Perl distribution by additional modules from CPAN.

The last step to perform is to make a tool called spamd running continously on your box. We will first configure the daemon according to your Linux distribution. On latest SuSE editions this is done by a file /etc/sysconfig/spamd:

## Path:           Network/Mail/Spamassassin
## Description:    Arguments for the spam daemon
## Type:           string
## Default:        "-d -c -L"
## ServiceRestart: spamd
#
# The arguments passed to spamd.
# See spamd(1) man page.
# Default is "-d -c -L"
SPAMD_ARGS="-d -c -u spamd -g spamd --socketpath=/tmp/spamd_full.sock"

We introduced a user and group called “spamd” here. You might need to configure them first on your system.

Finally, you can add according startup commands in your /etc/rc.d directory to make spamd starting at system boot. Here is a script that I use.

Part 2 of this series will concentrate on the issue how to pass each mail into SpamAssassin.

One reply on “Integrating SpamAssassin with qmail: Part 1”

Leave a Reply

Your email address will not be published. Required fields are marked *