Categories
Applications Linux

Integrating SpamAssassin with qmail: Part 2

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 2: Marking email as spam

Now, that we setup SpamAssassin to run as a continous process, we are able to change the qmail system to feed all emails into the server daemon. We need the root folder of qmail first. This is usually at /var/qmail. However, you better check with your installation first.

Create a file “qmail-queue.spamd” in subfolder bin that contains a single line:

/usr/bin/spamc -U /tmp/spamd_full.sock| /var/qmail/bin/qmail-queue.orig

Adapt the paths if necessary. Next step is to rename the existing qmail-queue program in subfolder bin. Name it “qmail-queue.orig”, as we have already used that pathname in our script. Make sure that all file permissions of qmail-queue.orig and qmail-queue.spamd match exactly the original qmail-queue binary.

Last step is to replace the existing qmail-queue binary by a link to our qmail-queue.spamd script. That’s it. All your emails do now pass the SpamAssassin daemon. You can check this by viewing all headers of emails passing your system. They should now contain additional SpamAssassin lines.

This is not the end of the story. We just marked email so far as spam or not. The will not get filtered out of the boxes, yet. This however is the topic of part 3 of this series.

2 replies on “Integrating SpamAssassin with qmail: Part 2”

Leave a Reply

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