Macallan Mail Solution


These instructions may change slightly with each version, so it is wise to read up on what's required each time before proceeding.
Note that the configuration is slightly different in each version.
You may wish to upgrade perl in conjunction with this since to do either requires disabling the processing of incoming e-mail to the e-mail server.

Information on running SpamD on Windows: SpamdOnWindows

[WWW] provides more detailed step by step information.
The below info is largely a digest of said info.
Please be advised that though this site provides more detailed step-by-step instructions, in some environments
(like CommuniGate Pro with CGPSA), using the older ActivePerl and Net::DNS modules causes a number of problems.
In other environments, his instructions may actually perform more reliably.

This installation procedure is for installing SpamAssassin in native Windows (not Cygwin) using ActivePerl or later 5.8.x.

  1. Install or upgrade Perl if required:
    • If upgrading, make note of any modules you need to reinstall, uninstall ActivePerl and delete the /perl folder tree.
    • Download the current ActivePerl version 5.8.x from
    • Install it.
    • Get nmake from Microsoft: [WWW]
    • Extract the nmake.exe and nmake.err files into your /perl/bin folder
    • Use PPM to install the required perl modules:
      ppm install Win32-Registry-File
      ppm install Net-DNS
      ppm install DB_File
      ppm install Time-HiRes
      ppm install IP-Country
      ppm install Mail-SPF-Query
  2. If you want to build spamc, install Microsoft Visual C++ 6.0 or later. For instructions on getting a no-cost version
    see BuildSpamcOnWindowsForFree.
    When you build SpamAssassin use a command prompt in which the VC++ environment variables are set.
  3. Download the SpamAssassin zip file from
  4. Back up your settings if you already have it running.
  5. Stop and disable SpamAssassin if it's running
  6. Delete ~SpamAssassin directories, which may include:
    • c:\etc\mail\spamassassin
    • c:\perl\etc\mail\spamassassin
    • c:\perl\share\spamassassin
    • c:\perl\site\lib\mail\ and spamassassin folder
    • c:\perl\etc\mail\spamassassin or c:\perl\site\etc\mail\spamassassin
    • c:\perl\html\site\lib\mail\spamassassin or c:\spamdocs or whereever you put the docs last time
    • c:\perl\bin\spamassassin.* and c:\perl\bin\sa-learn.*
  7. The following system environment variables may have to be set:
    • RES_NAMESERVERS=<your-dns-server-ip-address>
      • If you do not set this variable, SpamAssassin should use the first DNS server in your network configuration.
        That is useful when, for example, you move your computer between different networks and
         have DNS automatically assigned.
        If you experience problems with domain name resolution,
        try setting this variable to force SpamAssassin to use the specified nameserver.
    • LANG=en_US
      • This used to be required for SpamAssassin to work with perl 5.8.x.
        It should no longer be necessary, but there is no harm in having it set.
         If you have trouble getting SpamAssassin to run, try setting this.
  8. Install SpamAssassin:
    • extract it to the c:\ folder with use folder names
    • in a command prompt: cd\mail-spamassassin-3.0.2
    • perl
      • Answer the questions as they are asked.
    • nmake
    • nmake test
    • nmake install
  9. Generate the documentation. Make a batch file out of the following code and
    run it from the command prompt you started in the last step.
    This creates HTML documentation in the same directory structure that other perl documentation is already in, /perl/html/site/lib/mail/spamassassin.
    REM Run from the top of the SpamAssassin install directory
    mkdir \perl\html\site\lib\mail\spamassassin
    mkdir \perl\html\site\lib\mail\spamassassin\advanced
    mkdir \perl\html\site\lib\mail\spamassassin\plugins
    echo y|del \perl\html\site\lib\mail\spamassassin\*.* 
    echo y|del \perl\html\site\lib\mail\spamassassin\advanced\*.*
    echo y|del \perl\html\site\lib\mail\spamassassin\plugins\*.*
    call pod2html spamassassin.raw 
    	--outfile \perl\html\site\lib\mail\spamassassin\spamassassin.html 
    call pod2html sa-learn. --outfile \perl\html\site\lib\mail\spamassassin\sa-learn.html
    call pod2html lib\mail\spamassassin\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\advanced\AutoWhiteList.html 
    call pod2html lib\mail\spamassassin\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\Bayes.html 
    call pod2html lib\mail\spamassassin\Message\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\advanced\MessageMetaData.html 
    call pod2html lib\mail\spamassassin\Message\
    	--outfile \perl\html\site\lib\mail\spamassassin\advanced\MessageNode.html 
    call pod2html lib\mail\spamassassin\BayesStore\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\advanced\BayesStoreSQL.html 
    call pod2html lib\mail\spamassassin\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\advanced\BayesStore.html 
    call pod2html lib\mail\spamassassin\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\conf.html 
    call pod2html lib\mail\spamassassin\Conf\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\advanced\confSQL.html 
    call pod2html lib\mail\spamassassin\Conf\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\advanced\confLDAP.html 
    call pod2html lib\mail\spamassassin\Conf\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\advanced\confParser.html 
    call pod2html lib\mail\spamassassin\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\advanced\permsgstatus.html
    call pod2html lib\mail\spamassassin\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\advanced\message.html --quiet
    call pod2html lib\mail\spamassassin\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\advanced\permsglearner.html
    call pod2html lib\mail\spamassassin\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\advanced\PluginsArchitecture.html
    call pod2html lib\mail\spamassassin\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\advanced\Persistentaddrlist.html 
    call pod2html lib\mail\spamassassin\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\advanced\SQLBasedAddrList.html 
    call pod2html lib\mail\ 
    	--outfile \perl\html\site\lib\mail\spamassassin\advanced\spamassassinclass.html 
    cd lib\mail\spamassassin\plugin
    for %%f in (*.*) do call pod2html %%f 
    	--outfile \perl\html\site\lib\mail\spamassassin\plugins\%%f.html --quiet
    cd ..\..\..\..
  10. Copy the backed up configuration files into the site configuration folder, probably c:\perl\site\etc\mail\spamassassin.
  11. Simple test (you should have no errors): spamassassin -D < sample-spam.txt
  12. Make a test folder. Copy sample-spam.txt and sample-nonspam.txt to that folder.
  13. Open a command prompt to that folder.
  14. Test the two files. Make sure they both run fine and the spam reports on each result file are appropriate.
    • spamassassin -D -t < sample-nonspam.txt > results-nonspam.txt
    • spamassassin -D -t < sample-spam.txt > results-spam.txt

by BretMiller



This page originally was at


Last Updated: Feb, 14 - 2015 - 2003-2016 By Macallan