HOW TO: Install Spamassassin For Windows and SPAMD service – hMailServer forum

Visits: 8412

HOW TO: Install Spamassassin For Windows and SPAMD service

Post by jimimaseye » 2015-04-27 11:13

This tutorial is a re-publish of a tutorial already on this forum, but simplified for clarity). It’s aim is to install Spamassassin and its service for running in connection with the default integration with Hmailserver.

It is a simple procedure that should only take 5 minutes.

1, Download SpamassassinForWindows from Jam Software here:http://www.jam-software.com/spamassassin/index.shtml

2, Run the install of this software: I will assume defaults for all installation locations for this tutorial.
NOTE: You may need to switch off your firewall during this install so that it can auto update to latest spam rules during install. It will then create some firewall rules for you. Then switch firewall back on. If it has not added such exceptions itself as necessary, add the following programs (from the Spamassassin program directory) to the Firewall Exceptions (for PRIVATE network only). Failure to allow this program exception will result in failed updates (a) and service connection by Hmailserver (b):-

  • a) SA-UPDATE.EXE
    b) SPAMD.EXE

3, Download ‘NSSM Service Manager‘ (service installer) from: http://nssm.cc/download/?page=download
and save the unzipped folder to a disk location where you will run it from permanently (perhaps within program files directory if you wish).

! DO NOT MOVE THE NSSM PROGRAM FROM THIS LOCATION ONCE INSTALLED AS ITS AVAILABILITY IS REQUIRED FOR THE RESULTANT SERVICE TO RUN !

4, Within CMD prompt, CD to the “win64” directory of NSSM location (although they do claim that running win32 version on 64bit OS should still be ok):

5, Install the spamassassin service with this command:
nssm install

and using the onscreen prompts enter (copy) the following:

Version 2.15 (without GUI):

application/path: %ProgramFiles%\jam software\spamassassin for windows\spamd.exe <—- your spamassassin program with full path
options/arguments: -l -s “c:\path to\spamd.log” –round-robin –timeout-child=85 <—change the log path to wherever you wish to locate it **
service name: spamassassin <<—– However you want the service to be identified as.

Example with GUI (Version 2.24):

Untitled.png

(You may choose to write something meaningful in the ‘Description’ on the DETAILS tab for displaying in the Windows Services control panel.)

Hint: I chose the Hmailserver Log directory (“%ProgramFiles(x86)%\hMailServer\Logs“) as a consolidated logs directory so I specified it as the store for my Spamd.log file (c:\path to\spamd.log above).

6, You may wish to modify the ‘spamassassin’ service via services.msc and set the Recovery options to “Restart the service” for the 1st 2 recovery
failures – although I have not yet found it ever fails (not that I would know – I have it to restart if it does. :roll: )

7, HMS should now be enabled to use Spamassassin: hmailserver / settings / Anti Spam / SpamAssassin Tab – and tick/enable. The default port should be left at 783.

That’s it.

Additional Info/advice

Spamassassin requires definition updates (almost daily) just like an AV software. This is achieved by running the following command:

CODE: SELECT ALL

net stop spamassassin
sa-update.exe -v --nogpg --channelfile UpdateChannels.txt
net start spamassassin

You should include this command daily either by your regular housekeeping backup script or by Task Scheduler not forgetting to refer to the correct path.

** UPDATE: It has also been claimed that the “–round-robin” parameter is no longer needed and actually best to be left out to ensure trouble free and optimal operation in 3.4 onwards. However, with its inclusion I see no error or obvious drawback.

You may now choose how to use the Spamassassin scores. In Hmailserver you have the option to ‘Use score from Spamassassin’ (in the Spamassassin tab) or to simply assign a positive SA result a particular score of your own. There is no right or wrong, just personal preference. (My personal setup follows this post….)

HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs :https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

HOW TO: Install Spamassassin For Windows and SPAMD service Quote Post by jimimaseye » 2015-04-27 11:13 This tutorial is a re-publish of a tutorial already on this forum, but simplified for clarity). It’s aim is to install Spamassassin and its service for running in connection with the default integration with Hmailserver. It is a simple procedure that should only take 5 minutes. 1, Download SpamassassinForWindows from Jam Software here: http://www.jam-software.com/spamassassin/index.shtml 2, Run the in

Source: HOW TO: Install Spamassassin For Windows and SPAMD service – hMailServer forum

 test with this  in the content and maybe subject

XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X.

to have the subject marked as SPAM click Add to message subject

Change the Spam delete threshold to whatever number you feel can be utterly deleted and never seen. It might be healthy to set this really high, like 200 or more then to use spam filters in your email client, unless you don’t mind the risk.

Leave a Reply