Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Clarified the status of the page in response to Bug #7820

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.

Warning! SpamAssassin 3.0.1 may have a bug with the URIDNSBL plugin on Windows. See http://bugzilla.spamassassin.org/show_bug.cgi?id=3924. SpamAssassin 3.0.0 seems to have a bug in this environment where certain messages will cause it to crash. You may wish to try to upgrade to SpamAssassin 3.0.1 if you encounter crashing.

Information on running SpamD on Windows: SpamdOnWindows

You'll also find a pre compiled version of SpamAssassin for Windows that can simply be extracted and run here: http://www.openhandhomejam-software.com/spamassassin/howtosa.html 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..

Note: The instructions below describe an obsolete procedure using tools which may no longer be available. They  reportedly do not work for SpamAssassin 3.4.1 using ActivePerl 5.20.2. ActivePerl now seems to force the use of dmake for Windows and some work will likely need to be done to make SpamAssassin compatible. We are seeking a working procedure for installation on modern versions of Windows. If  you can help, please send a  note to the dev list to get access to edit the Wiki. 

This HISTORICAL This installation procedure is for installing SpamAssassin in native Windows (not CYGWINCygwin) using ActivePerl (Tested on ActivePerl 5.8.49.810.827).

  1. Download the SpamAssassin zip file from www.spamassassin.org 2. Back up your settings if you already have it running. 2. Stop and disable SpamAssassin if it's running 3. Delete ~SpamAssassin directories, which may include:
  2. c:\etc\mail\spamassassin
  3. c:\perl\etc\mail\spamassassin
  4. c:\perl\share\spamassassin
  5. c:\perl\site\lib\mail\spamassassin.pm and spamassassin folder
  6. c:\perl\etc\mail\spamassassin or c:\perl\site\etc\mail\spamassin
  7. c:\perl\html\site\lib\mail\spamassassin or c:\spamdocs or whereever you put the docs last time
  8. c:\perl\bin\spamassassin.* and c:\perl\bin\sa-learn.*
    4. Make sure the following system environment variables are set:
  9. RES_NAMESERVERS=<your-dns-server-ip-address>
  10. LANG=en_US
    5. 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 ActivePerl version 5.8.4.810 (or newer 5.8.4 version) 9.827 from www.activestate.com.
    • Install it.
    • Get nmake from Microsoft: http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe
    • Extract the nmake.exe and nmake.err files into your /perl/bin folder
    • Use PPM to install the required perl modules:

      No Format
      ppm install Win32Net-Registry-FileDNS
      ppm install Net-DNSNetAddr-IP
      


    • Use PPM to install the optional perl modules:

      No Format
      
      ppm repo add tcool
      ppm install DB_File
      ppm install TimeMail-HiResSPF
      ppm install IP-Country
      ppm install MailNet-SPF-Query
      
      7. Install SpamAssassin:
      Ident
      ppm install IO-Socket-INET6
      ppm install IO-Socket-SSL
      ppm install Encode-Detect
      ppm repo add bribes
      ppm install Mail-DKIM
      


  11. 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.
  12. Download the SpamAssassin zip file from www.spamassassin.org
  13. Back up your settings if you already have it running.
  14. Stop and disable SpamAssassin if it's running
  15. Delete ~SpamAssassin directories, which may include:
    • c:\etc\mail\spamassassin
    • c:\perl\etc\mail\spamassassin
    • c:\perl\site\share\spamassassin
    • c:\perl\site\var\spamassassin
    • c:\perl
    • extract it to the c:\ folder with use folder names
    • in a command prompt: cd\mail-spamassassin-3.0.1
    • perl makefile.pl
    • nmake /I
    • nmake install /I
      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. No Format 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\AutoWhiteList.pm --outfile \perl\html\site\lib\mail\spamassassin\advanced\AutoWhiteList.html call pod2html lib\mail\spamassassin\Bayes.pm --outfile \perl\html\site\lib\mail\spamassassin\Bayes.html call pod2html lib\mail\spamassassin\Message\Metadata.pm --outfile \perl\html\site\lib\mail\spamassassin\advanced\MessageMetaData.html call pod2html lib\mail\spamassassin\Message\Node.pm --outfile \perl\html\site\lib\mail\spamassassin\advanced\MessageNode.html call pod2html lib\mail\spamassassin\BayesStore\SQL.pm --outfile \perl\html\site\lib\mail\spamassassin\advanced\BayesStoreSQL.html call pod2html lib\mail\spamassassin\BayesStore.pm --outfile \perl\html\site\lib\mail\spamassassin\advanced\BayesStore.html call pod2html lib\mail\spamassassin\conf.pm --outfile \perl\html\site\lib\mail\spamassassin\conf.html call pod2html lib\mail\spamassassin\Conf\SQL.pm --outfile \perl\html\site\lib\mail\spamassassin\advanced\confSQL.html call pod2html lib\mail\spamassassin\Conf\LDAP.pm --outfile \perl\html\site\lib\mail\spamassassin\advanced\confLDAP.html call pod2html lib\mail\spamassassin\Conf\Parser.pm --outfile \perl\html\site\lib.pm and spamassassin folder
    • c:\perl\site\etc\mail\spamassassin\advanced\confParser.html call pod2html lib\mail\spamassassin\permsgstatus.pm --outfile \
    • c:\perl\html\site\lib\mail\spamassassin \advanced\permsgstatus.html call pod2html lib\mail\spamassassin\message.pm --outfile \perl\html\site\lib\mail\spamassassin\advanced\message.html --quiet call pod2html lib\mail\spamassassin\permsglearner.pm --outfile \perl\html\site\lib\mail\spamassassin\advanced\permsglearner.html call pod2html lib\mail\spamassassin\plugin.pm --outfile \perl\html\site\lib\mail\spamassassin\advanced\PluginsArchitecture.html call pod2html lib\mail\spamassassin\persistentaddrlist.pm --outfile \perl\html\site\lib\mail\spamassassin\advanced\Persistentaddrlist.html call pod2html lib\mail\spamassassin\SQLBasedAddrList.pm --outfile \perl\html\site\lib\mail\spamassassin\advanced\SQLBasedAddrList.html call pod2html lib\mail\spamassassin.pm --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 ..\..\..\.. 8. or c:\spamdocs or whereever you put the docs last time
    • From c:\perl\bin\, delete spamassassin.*, sa-learn.*, sa-compile.* and sa-update.*
  16. 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.
  17. extract the zip file (make sure your extraction tool is able to handle unix style files, WinRar is a good choice, IZArc IS NOT!)
  18. Install SpamAssassin:
    • open command prompt and switch to your spamassassin source directory and type
    • perl makefile.pl
      • Answer the questions as they are asked. Remember you can NOT build spamc without a C compiler installed and its environment set up.
    • nmake
    • nmake test (this is optional)
    • nmake install
  19. Documentation should now be generated automatically by the install.
  20. Copy the backed up configuration files into the site configuration folder, probably c:\perl\site\etc\mail\spamassassin. 0. Simple test (you should have no errors): spamassassin -D < sample-spam.txt
  21. Make a test folder on the D: drive. Copy sample-spam.txt and sample-nonspam.txt to that folder. 2.
  22. Open a command prompt to that folder.
  23. Type sa-update --nogpgp
  24. 3. 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

Once it's installed, you can edit the local.cf file in c:\perl\site\etc\mail\spamassassin. You may want to visit http://www.rulesemporium.com and get extra rulesets. These rulesets should also go in the c:\perl\site\etc\mail\spamassassin folder. (This assumes you've installed activeperl in c:\perl as it defaults to. If you install it somewhere else, you'll need to adjust the path accordingly.)

Note: To use sa-update with GPG, download GPG for Windows, install it and add the 8.3 file path to your system path. The default path would be C:\PROGRA~1\GNU\GNUPG.

by BretMiller

modified for 3.3.1 by DanielLemke