Setting up Spam Bouncer

Setting up Spam Bouncer

Spam Bouncer is a set of procmail
recipes, or instructions, which search the headers and text of your incoming email to see
if it meets one or more conditions.  The Spam Bouncer home page is and I’ve just installed
it.  The rest of this article will show you what I did to install it on a FreeBSD

I’m not running Spam Bouncer right now.  I did use it for a while, but I
didn’t have time for the fine tuning which needs to be done after installation.  I’ll
hopefully come back to that soon.

Things to remember

I use sendmail as my mail transport agent (MTA).  You may
not.  If so, you will need to make adjustments to the things you read below.

I use
a Windows mail client (Pegasus, it’s free and built
in New Zealand).  So I have configured everything for use with Pegasus (which is a
POP client).  You won’t want to follow these instructions if you don’t use POP. 
If you don’t know whether or not you use POP, I suggest you read the Spam Bouncer home
page (URL is above).

I will assume you already have procmail installed
and working.

Getting Spam Bouncer

You can download Spam Bouncer from
  Put this file in ~/procmail and untar it:

mkdir ~/procmail
cd ~/procmail
tar xvfz spambnc.tar.Z

You can get a sample procmail.rc file from
I used this file for setting up Spam Bouncer.  I saved this file as ~/.procmailrc

I learned how to do this by reading Getting Started With Procmail.

Configuring the sample procmail.rc file

Here are the changes I made to the sample file I downloaded in the
previous section.  Don’t make these changes without understanding what they
mean.  Read the sample file, make your decisions, and adjust accordingly.

This is a
directory which must exist.  Make sure you create it.


So I created it:

mkdir ~/Mail

And the backup directory:

mkdir ~/Mail/backup

These are the changes to ~/.procmailrc that I made:

This is where my mail is normally delivered by sendmail.


If you are using Eudora, Pegasus Mail, Netscape, Internet Explorer, or another Windows-
or Mac-based POP email program, you will want to make these changes:


Spam Bouncer will add special headers to the mail message.  You can use this to
filter your incoming mail if you are using a POP email client.  Please read this for
more information:

Change the following to be a valid reply-to address which will be used when sending
messages to spammers.  Don’t use this example:

What email addresses do you use?

You need to create a list of all the email addresses you use.  This
goes into ~/myemail.

Here’s how I did that from my /etc/mail/virtusertable

grep @ /etc/mail/virtusertable |awk ' {print $1}' > ~/.myemail

But that left some comments in the file:


I removed them like this:

grep @ /etc/mail/virtusertable | grep -v ^# | awk ' {print $1}' > ~/.myemail

Check the contents of ~/.myemail before you proceed.

Invoking procmail

Remember, I’ve assumed you’ve already configured procmail, but if
you haven’t see procmail – a simple example for what you need
to put in ~/.forward.


I suggest you run in SILENT mode for a while.  Perhaps a week or two.
  Make sure you’re not getting false blocks etc.

I was able to get Spam Bouncer
running.  Remember that procmail can be CPU hungry.

1 thought on “Setting up Spam Bouncer”

Leave a Comment

Scroll to Top