INSTALL   [plain text]



Note For Users Upgrading From SpamAssassin 2.5x
-----------------------------------------------

Due to major reliability shortcomings in the database support libraries
other than DB_File, we now require that the DB_File module be installed to
use SpamAssassin's Bayes rules.

SpamAssassin will still work without DB_File installed, but the Bayes
support will be disabled.

If you install DB_File and wish to import old Bayes database data, each
user with a Bayes db should run "sa-learn --import" to copy old entries
from the other formats into a new DB_File file.

Due to the database library change, and the change to the database format
itself, you will want to do something like this when upgrading:

- stop running spamassassin/spamd (ie: you don't want it to be running
  during the upgrade)
- run "sa-learn --rebuild", this will sync your journal.  if you skip this
  step, any data from the journal will be lost when the DB is upgraded.
- install DB_File module if necessary
- upgrade SA to 2.6x
- if you were using another database module previously, run
  "sa-learn --import" to migrate the data into new DB_File files
- run "sa-learn --rebuild", this will cause the db format to be upgraded.
  if you want to make sure everything runs correctly, you can add the "-D"
  option.
- test the new database by running some sample mails through SpamAssassin,
  and/or at least running "sa-learn --dump" to make sure the data looks
  valid.
- start running spamassassin/spamd again

Obviously the steps will be different depending on your environment,
but you get the idea. :)



Note For Users Upgrading From SpamAssassin 2.3x or 2.4x
-------------------------------------------------------

SpamAssassin no longer includes code to handle local mail delivery, as it
was not reliable enough, compared to procmail.  So now, if you relied on
spamassassin to write the mail into your mail folder, you'll have to
change your setup to use procmail as detailed below.  If you used
spamassassin to filter your mail and then something else wrote it into a
folder for you, then you should be fine.

Support for versions of the optional Mail::Audit module before 1.9 is no
longer included.

The default mode of tagging (which used to be ***SPAM*** in the subject
line) no longer takes place.  Instead the message is rewritten.

Using Razor version 1 is no longer supported.  Please upgrade to Razor
version 2 and also read the instructions located in the Razor2.patch
file.


Installing or Upgrading SpamAssassin
------------------------------------

The easiest way to do this is using CPAN.pm, like so:

	perl -MCPAN -e shell                    [as root]
	o conf prerequisites_policy ask
	install Mail::SpamAssassin
	quit

On Debian, you can apt-get it from unstable, thanks to Duncan Findlay.

Alternatively download the tarfile, zipfile or Red Hat RPM from
http://spamassassin.org/ , and install that, like so:

	[unzip/untar the archive]
	cd Mail-SpamAssassin-*
	perl Makefile.PL
	[option: add -DSPAMC_SSL to $CFLAGS to build an SSL-enabled spamc]
	make
	make install                            [as root]

To install as non-root, do something like this:

	[unzip/untar the archive]
	cd Mail-SpamAssassin-*
	perl Makefile.PL PREFIX=~/sausr SYSCONFDIR=~/saetc
	[option: add -DSPAMC_SSL to $CFLAGS to build an SSL-enabled spamc]
	make
	make install

If you are running AFS, you may also need to specify INSTALLSITELIB and
SITELIBEXP.

This will install the SpamAssassin modules and rules below the ~/sausr
and ~/saetc directories off your home directory. Please see the file
PACKAGING, sections "Changing paths in the Makefile" and "Setting further
options on the command line" for more informations on available command
line variables.

Note that you can upgrade SpamAssassin using these instructions, as long
as you take care to read the caveats at the top of this file.   Upgrading
will not delete your learnt Bayes data or local rule modifications.


SunOS Note
----------

Under SunOS, snprintf is not defined.  A library containing a SunOS version of
snprintf is included in contrib/snp.tar.gz, which is usable for building SA.
Mike Nolan <nolan AT naic dot edu> has built this, and here's his directions:

  I built SpamAssassin under SunOS 4.1.3.  (...)

  % cd contrib
  % gtar xzf snp.tar.gz
  % cd snp
  % gmake libsnp.a

  OK, now go to the spamassassin directory, and compile:

  % cd ..
  % gcc -g -O2 spamd/spamc.c spamd/libspamc.c spamd/utils.c \
          -o spamd/spamc -ldl -lnsl contrib/snp/libsnp.a -lm
  % gmake
  
  Now you have spamc and spamd.


Note for Perl 5.8 Users (incl Red Hat 8)
----------------------------------------

Perl 5.8 now uses Unicode internally by default, which causes trouble for
SpamAssassin (and almost all other reasonably complex pieces of perl
code!).

We've worked around this in most places, as far as we know, but there may
still be some issues.  In addition, there is a speed hit, which it would
be nice to avoid.

Setting the LANG environment variable before any invocation of
SpamAssassin sometimes seems to help fix it, like so:

  export LANG=en_US

Notably, the LANG setting must not include "utf8".   However, some folks
have reported that this makes no difference. ;)


Installing SpamAssassin for Personal Use (Not System-Wide)
----------------------------------------------------------

These steps assume the following, so substitute as necessary:
  - Your UNIX login is "user"
  - Your home directory is /home/user
  - The location of the procmail executable is /usr/bin/procmail

1. Uncompress and extract the SpamAssassin archive, using "unzip" or "tar
xvfz", in a temporary directory.

2. change directory into it:

	cd Mail-SpamAssassin-*

3. Make SpamAssassin as normal, but using your home directory as the
target:

	perl Makefile.PL PREFIX=~/sausr SYSCONFDIR=~/saetc
	make
	make install

Please see the file PACKAGING, sections "Changing paths in the Makefile"
and "Setting further options on the command line" for more informations
on available command line variables.

4. If you already use procmail, skip to step 6.  If not, ensure procmail
is installed using "which procmail" or install it from www.procmail.org.

5. Create a .forward file in your home directory containing the below
lines:

"|IFS=' ' && exec /usr/bin/procmail -f- || exit 75 #user"

6. Edit or create a .procmailrc file in your home directory containing the
below lines.  If you already have a .procmailrc file, add the lines to the
top of your .procmailrc file:

:0fw: spamassassin.lock
| /home/user/sausr/bin/spamassassin

The above line filters all incoming mail through SpamAssassin and tags
probable spam with a unique header.  If you would prefer to have spam
blocked and saved to a file called "caughtspam" in your home directory,
instead of passed through and tagged, append this directly below the above
lines:

:0:
* ^X-Spam-Status: Yes
caughtspam

7. Now, you should be ready to send some test emails and ensure everything
works as expected.  First, send yourself a test email that doesn't contain
anything suspicious.  You should receive it normally, but there will be a
header containing "X-Spam-Status: No".  If you are only tagging your spam,
send yourself an obvious spam mail and check to be sure it is marked as
spam.  If your test emails don't get through to you, immediately rename
your .forward file until you figure out cause of the the problem, so you
don't lose incoming email.


Required Modules
----------------

These modules are required for spamassassin to build:

  - ExtUtils::MakeMaker >= 5.45 (from CPAN, or included in Perl 5.6 and
                                 higher)

    The ExtUtils::MakeMaker module is required in version 5.45 or later.
    Without the proper version the build will fail to create the Makefile.
    This is included in Perl versions 5.6 and later.

    Version 6.16 or later is recommended.


These modules are required for spamassassin to run:

  - File::Spec >= 0.8    (from CPAN, or included in Perl 5.6 and higher)

    The File::Spec module is required in version 0.8 (Mar 2000) or later.
    This is included in Perl versions 5.6 and later.

  - Pod::Usage >= 1.10   (from CPAN, or included in Perl 5.6 and higher)

    The Pod::Usage module is required.  This is included in Perl versions
    5.6 and later.  The modules shipped with earlier versions  are buggy
    and need to be upgraded.

  - HTML::Parser >= 3.24 (from CPAN)

    Version 3.29 or later is recommended.

    HTML is used for an ever-increasing amount of email so this dependency
    is unavoidable.  Run "perldoc -q html" for additional information.

    If you use Debian, you can get HTML::Parser from the libhtml-parser-perl
    package.

  - Sys::Syslog          (from CPAN)

    This is a required module if you use spamd.  spamd logs information
    about scanned messages to syslog using this module.

    Note: perl versions 5.003_07 and later should have Sys::Syslog already
    installed.  You can easily test this by running:
    perl -MSys::Syslog -e 1

    If it generates an error, you need to install the module.  If the
    command just returns, you should be ok.


Optional Additional Modules
---------------------------

In addition, the following modules will be used for some checks, if
available.  If they are not available, SpamAssassin will still work, just
not as effectively -- some of the spam-detection tests will have to be
skipped.


  - DB_File	(from CPAN)

    Used to store data on-disk, for the Bayes-style logic and
    auto-whitelist.  *Much* more efficient than the other standard Perl
    database packages.  Strongly recommended.

	perl -MCPAN -e shell
	o conf prerequisites_policy ask
	install DB_File
	quit


  - Net::DNS	(from CPAN)

    Used to check the RBL, RSS, DUL etc. and perform MX checks.
    Recommended.

	perl -MCPAN -e shell
	o conf prerequisites_policy ask
	install Net::DNS
	quit


  - Razor	http://razor.sourceforge.net/

    Used to check message signatures against Vipul's Razor collaborative
    filtering network.  Razor is not available from CPAN -- you have to
    download it from the URL above.

    Razor has a large number of dependencies on CPAN modules.  Feel free
    to skip installing it, if this makes you nervous; SpamAssassin will
    still work well without it.

    Note that Razor support does not seem to work on Windows systems.
    Win32 users should disable the Razor tests using "score RAZOR2_CHECK 0".

    You (and any users who use Razor) will need to register an account
    to do so, like this:

	# razor-client          [creates symbolic links]
	# razor-admin -create   [creates the razor home]
	# razor-admin -register [registers an account]
    
    If you want to use Razor and you are using Vipul's Razor 2.22 or higher
    (until at least 2.36), you need to apply a small patch to use Razor in
    "taint mode" which is now the default in SpamAssassin.  The instructions
    are located in the Razor2.patch file.


  - DCC    http://www.rhyolite.com/anti-spam/dcc/

    DCC (Distributed Checksum Clearinghouse) is a system similar to Razor.
    It supports fuzzy checksums and therefore detects some more spams than
    Razor does at the moment.

    To install it, download
    http://www.rhyolite.com/anti-spam/dcc/source/dcc-dccproc.tar.Z and
    perform the following steps:

	# tar xfvz dcc-dccproc.tar.Z
	# cd dcc-dccproc-X.X.X
	# ./configure && make && make install
	# cdcc 'info'

    The last command will give some output. One line of it should contain
    something like:

	dcc.rhyolite.com,-         RTT+0 ms    anon

    Note that MIMEDefang users may need to set the 'dcc_path'
    configuration setting, since MIMEDefang does not set a PATH by
    default.


  - Pyzor    http://pyzor.sourceforge.net/

    Used to check message signatures against the Pyzor collaborative
    filtering network.  Pyzor was initially "a Python implementation of
    Razor", but now also uses its own (free) server architecture and is
    "based upon a new, lighter, more language-independent protocol."

    Pyzor requires at least Python 2.2.1 which can be found at
    http://www.python.org/ .
 
    To install Pyzor, download the latest revision from
    https://sourceforge.net/project/showfiles.php?group_id=50000 and
    perform the following steps:

        # bunzip2 pyzor-*.tar.bz2
        # cd pyzor-*
        # python setup.py build
        # python setup.py install

    Note that your system might install the modules and scripts with
    non-world-readable permissions.  Correct this with a command such as:

	# chmod -R a+rX /usr/share/doc/pyzor \
		/usr/lib/python2.2/site-packages/pyzor \
		/usr/bin/pyzor /usr/bin/pyzord

    Read the INSTALL document if you want to setup your own Pyzor server and
    signature store.  Otherwise, you can just use the public servers.

    Note that MIMEDefang users may need to set the 'pyzor_path'
    configuration setting, since MIMEDefang does not set a PATH by
    default.


  - Mail::Audit, Mail::Internet, Net::SMTP	(from CPAN)

    If you want to use SpamAssassin with Mail::Audit, you will (obviously)
    require the Mail::Audit module, and any modules it requires (there's
    lots of them, unfortunately).
    
    Additionally, Mail::Internet is required if you wish to use the
    "-r/-w" options of the spamassassin program (reporting and replying,
    for spam-trap mail accounts).

    If you use procmail, KMail, 'spamassassin', or you plan to use
    'spamd', you will *not* need these.

    Here's how to install them using CPAN.pm:

	perl -MCPAN -e shell
	o conf prerequisites_policy ask
	install Mail::Audit
	quit


  - Digest::SHA1  (from CPAN)

    The Digest::SHA1 module will speed up some cryptographic hash tests,
    but is not required (although it may be required by another module).

    If you use Debian, you can get Digest::SHA1 from the libdigest-sha1-perl
    package.


  - Net::Ident   (from CPAN)

    If you plan to use the --auth-ident option to spamd, you will need
    to install this module.


  - IO::Socket::SSL	(from CPAN)

    If you wish to use SSL encryption to communicate between spamc and
    spamd (the --ssl option to spamd), you need to install this
    module. (You will need the OpenSSL libraries and use the
    ENABLE_SSL="yes" argument to Makefile.PL to build and run an SSL
    compatibile spamc.)


What Next?
----------

Take a look at the USAGE document for more information on how to
use SpamAssassin.


(end of INSTALL)

// vim:tw=74: