How To Configure SpamAssassin for HMailserver in Windows Server 2003

Posted By: Tech Guy
Last Updated at 9:40 PM on Sunday Dec 6, 2009
Found in: Anti-SpamE-Mail

Setting up SpamAssassin for MailServer in Windows is a tricky thing to do.

Documentation on the subject is sparse and Google searches turn up very old posts or posts that point you in the wrong direction. Fortunately once you know the setup process, it is fairly straightforward and easy to do.

There are several different versions of SpamAssassin out there. The main branch requires you to download the source code, then download perl to compile the source as binaries. Fortunately in our case, there is already versions compiled for Windows in the form of SAWin32.

How to Configure SpamAssassin for HMailserver in Windows

  1. Download SAWin32 3.2.3.3, which is the latest windows build of SpamAssassin (As of September 8, 2009).
  2. Download the latest SpamAssassin for Win32 command-line tools 3.2.3.5
  3. Unzip both files into your computer with HMailServer installed under the path "c:\sa\"
  4. Next we will have to create a new Windows Service called "SpamAssassin". This will allow HMailServer to use SpamAssassin.
    1. Install the Windows Server 2003 Resource Kit Tools. This will give you the necessary INSTSRV.EXE and SRVANY.EXE files to run SA as a service
    2. Go to Start Menu -> Run -> cmd
    3. Under the command line, enter in the following line (with quotes):
      "C:\Program Files\Windows Resource Kits\Tools\INSTSRV.EXE" SpamAssassin "C:\Program Files\Windows Resource Kits\Tools\SRVANY.EXE"

    4. Once installed, open up Regedit
    5. Go to HKLM -> SYSTEM -> CurrentControlSet -> Services -> SpamAssassin
    6. Add a new key called "Parameters"
    7. Under Parameters, add a new String Value of Application, and set the value data to (without quotes):
      "c:\sa\spamd.exe -l -s c:\sa\spamd.log --round-robin"

    8. Then go to the services control panel and start up the spam assassin service.
    9. If there are any issues, check the c:\sa\spamd.log file for more info
  5. Then you might have to allow dccproc and spamassassin in your firewall
  6. Adjust your hMailServer settings to allow the incoming e-mail check against SpamAssassin
  7. And finally you might have to restart your hMailServer service for the new service to take effect.
Anyway, it took me quite a while to figure it out, but once I did, I have been spam free! Good Luck!


Article Comments

 
hi, why do i have to use C:sa ?
i have hmail installed in default directory.

thanks
Marcelo


marcelo
Sat Oct 17, 2009 10:43 AM

Worked like a charm, thanks for posting this!

XaivierX
Tue Oct 20, 2009 6:52 PM

Thanks!
It worked perfectly. This is the only howto I have found after a lot of search.
Tested on Windows Server 2007 with "Windows Server 2003 Resource Kit Tools".

emilio
Sat Oct 24, 2009 11:12 PM

Correction: Windows Server 2008. (mistyped)

emilio
Sun Oct 25, 2009 10:44 AM

Marcelo, c:\sa is where you unzip the first two files to. In this folder we're installing the files for the SpamAssassin spam filter, not hMailServer.

If you put SpamAssassin somewhere other than the c:\sa folder, be sure to change the paths specified in Step 4.7.

Aaron
Mon Oct 26, 2009 2:49 PM

Hi, is necesary or useful install the SAWin32? It's for e-mails clients, no for servers, in this case for hmailserver.

Thanks for the how-to.

Daniel
Sat Oct 31, 2009 6:48 PM

Hi, is necesary or useful install the SAWin32? It's for e-mails clients, no for servers, in this case for hmailserver.

Thanks for the how-to.

Daniel
Sat Oct 31, 2009 6:59 PM

Hello Tech Guy,
When I do the install of spamD.exe as a service (point 4.8 on your tutorial), it return an error : can't start the service.
So, until I founded you tutorial I heard about "SpamDloaderService" ( http://www.tooms.dk/software/spamdloaderservice/ ) and it's ok.

So to install it :
1. download and unpack to : C:\spamdloaderservice\
2. run : InstallService.bat
3. run : SpamDloaderConfig.exe
3.1 on "spanD" change path to : C:\SA\SpamD.exe and save
3.2 return to "spamDloader" and try to start.

Bye..
Aktar




Aktarcom
Mon Nov 16, 2009 4:41 PM

Great procedure, much appreciated!

After the terrible stuff, incorrect build procedures and all the other junk references on the web and on Spamassassins site.

Question, why did you go with version 3.2.3.3 when the current version of Spamassassin has been 3.2.5 for well over a year?

Mike
Fri Dec 4, 2009 7:54 PM

if spamassassin is pre installed on the server, as is the case with me. I installed hmail server later then what should be the procedure.

Thanks.

KP
Tue Dec 22, 2009 1:09 PM



Jeppe
Fri Feb 12, 2010 2:36 PM



Jeppe
Fri Feb 12, 2010 2:36 PM



Jeppe
Fri Feb 12, 2010 2:37 PM

weird

Jeppe
Fri Feb 12, 2010 2:37 PM

Hm it will not post my message :S! But thanks it works

Jeppe
Fri Feb 12, 2010 2:38 PM

SAWin32 3.2.3.3 is extremely outdated, and looks to be not supported since about 2007.

It also is very troublesome under windows in general. If you can, install SA on a *NIX platform.

OmeD
Tue Mar 16, 2010 11:27 AM

Hello Tech Guy,
thanks for posting this!

After installation I have update the spam-detecting rules with the command :
sa-update.exe --nopgp
Download sa-update from http://sawin32.sourceforge.net/
This is necessary to update some rules like FH_DATE_PAST_20XX

emmex
Tue Apr 13, 2010 11:07 AM



Greg
Tue May 4, 2010 5:46 AM



Greg
Tue May 4, 2010 5:46 AM



Greg
Tue May 4, 2010 5:50 AM

Hello,

This is a great procedure. I installed SA on Server 2003 and it seems everything worked. I was able to start the service and go in hmailserver and start SA. Only I'm getting an error when I double-click the SAProxy "Can't create listen socket on port 110: unknown error at line 490 pl". Do you know what this is? How can I tell if SA is working? Thanks for any help you can provide.

Joe

Joe
Mon Jun 7, 2010 7:52 AM



Post a Comment

 


Name:


E-Mail:


Comments:  






Copyright 2010 Alter Procedure All Rights Reserved