Installing ASSP Email Spam Filter on a Windows Server

In an attempt to combat spam, I have in the past tried various solutions, the most effective were the IP Block Lists within Exchange. However, since zen.spamhaus.org stopped working (anyone know why?), this hasn’t been quite so reliable. Another option available to me was to build my own spam filter. I came across ASSP (Anti-Spam SMTP Proxy) and it seemed to tick all the boxes, and as always, it’s free! The website claims “the absolute best SPAM fighting weapon that the world has ever known!”, which is pretty bold, so it seemed like it was worth a shot.

I initially started installing this on a 64bit 2k8 box, but ran in to a few issues, so I now having it running on a 32bit 2k3 box. As it turns out, I don’t think the problem I faced on my initial attempts were down to it being a 64bit box, but more down to me not reading the instructions carefully enough, pah, who needs instructions anyway.

Once you have the hang of it, the install is actually pretty straight forward. That being said, my current running box still has a couple of modules missing, so once I’m done with this article, I’m going to build another box from scratch and iron out all the minor issues there.

If you are having issues, check out the Wiki and the Forum, there’s lots of very useful information on them.

Anyway, to install it you pretty much want to do this (or follow the included Win 32 Quick Start Guide):

Grab a copy of ActiveState Perl (from here), I’m running Version 5.12.4 Build 1205, and install that on you server.

Grab a copy of ASSP (from here), I’m running version 2.0.1 3.2.01, unzip this to c:\ASSP.

Grab a copy of assp.mod.zip (from here), I used version 1.17 and then extract this folder to you c:\ASSP folder.

Now you have all the files you need, in a command window, navigate to c:\assp\assp.mod\install and type ‘perl mod_inst.pl’, this will take some time, so go and make a cup of tea. It’s at this point that you may see some errors, but it’s worth nothing that ASSP can still function even with some modules missing, so it’s probably worth ignoring them for the moment, testing the software, and if then you decide you may want to use it longer term, then try and tackle the failed modules.

Next, open up the assp.cfg file and navigate to line 829 and change the webAdminPassword to something memorable.

Then, navigate to c:\assp and type ‘perl assp.pl’, this again will take a few seconds but will basically run ASSP. Once running, you can navigate to http://machine.ip:55555 and login using the username root and the password that you set earlier. (You can change to port from 55555 in the config if you wish)

If it works, do a ctrl-z in the command window and then we want to set this to run as a service (which you can then monitor using PRTG or similar).

To run this as a service you will need to run this command:

Perl assp.pl c:\assp –i

And all going will, it will return “ASSP Service successfully added”. You can then view your services, check that it’s set to automatic and start it.
Now for some of the commands that I used on the previous installs, which might be of use to you.
Firstly, adding modules into Perl. You can download modules using the Perl Package Manager (just run ppm) or you can download them from http://search.cpan.org. When you download the tar’s, unzip them using 7zip and then using a command prompt navigate to the folder where you extracted them to. You can then run:

  • Perl MakeFile.PL
  • nmake
  • nmake test
  • nmake install

This occasionally returned syntax errors, and it turns out that nmake had been replaced with dmake, so instead type:

  • Perl MakeFile.PL
  • dmake
  • dmake test
  • dmake install

There a full guide here on installing Perl modules.

Anyway, once running as a service it was then time to configure ASSP from the webgui, which was a little daunting at first with all the options available to me. The very basic bits you will want to set are:

  • SMTP Listen Port (25 is the default for SMTP)
  • SMTP Destination (Your mail server)

And then apply the settings. I also created two files in c:\assp\

  • domains.txt
  • relayips.txt

Domains.txt contains all the domains that I accept on my mail server and relayips.txt contains all the IP’s that I want to allow to relay through my Exchange box. Obviously you need to make sure that your exchange box is setup to accept emails from ASSP, this is easily done via the Exchange Management Console. Then in the ASSP GUI under relaying, set Accept All Mail to ‘file:relayips.txt’ and under Recipient/Local Domains, set Local Domains to ‘file:c:/assp/domains.txt’. Adding file: before it just allows you to edit the file from within the GUI.

You will then want to change the NAT on your firewall to send TCP/25 (SMTP) to ASSP rather than Exchange.

There are plenty more options to set, but you can browse through these in your own time. You may want to check out the While List and RBL, as some of these no longer work, i.e. zen.spamhaus.org.

Once I had it working, it turned out that a ‘feature’ of the software was to add text to the top of every email that it passed through the filter, this was a little annoying. Somebody else had already posted this as a question on the forum (see here). This is perhaps frowned upon, but if you edit the file c:\assp\assp.pl and navigate to line 10630 which should look like this:

$Con{$client}->{rcvd}=”Received: from =host ([$ip] helo=) by $myName with *SMTP* ($version); $time $tz\r\n”;

Then just delete that entire line and you should notice that all emails that pass the spam filter are now unaffected.

If you click on SMTP Connections on the left menu, it will take you to a seperate tab where you can monitor the live smtp connections in real time, which is quite nice.

It’s also worth noting that while I have ASSP working now, I’m a long way off being any sort of expert on it, that can only come with time, which I’m pretty low on right now, but watch this space.

  • http://martin.bz/ Meixger

    I’m using ASSP since 7 years in front of my SBS/Exchange box, and it works great!

    i’m also using the AsspToolbar, so the user can notify Spam/Ham.

  • Jason

    Thanks for the post. You got me going with what seemed to be a daunting task!

    Question though. Are you still using ASSP? If so, what version of Perl are you running and were you able to get all the modules installed? The one that’s really giving me fits is the Email-Mime-Modifier module. It doesn’t exist on the latest version of Perl, so I installed perl 5.10 which had the module just fine. But ASSP said I should use Perl 5.12.3 or higher, so I installed it but now the module isn’t there.

    It’s kind of driving me crazy. :)

    • dphuk

      I’ve changed jobs and am no longer using it I’m afraid. Sorry I cant be of more help, maybe Mex will get this update and might have an answer?