Upgrading SpamAssassin?

Please be sure to read the UPGRADE file for important changes that have been made since previous versions. In particular, 3.3.0 no longer includes a default ruleset.

Installing or Upgrading SpamAssassin

Using CPAN via CPAN.pm:

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

Using Linux:

        Debian unstable: apt-get install spamassassin
        Gentoo: emerge mail-filter/spamassassin
        Fedora: yum install spamassassin

Alternatively download the tarfile, zipfile, and/or build your own RPM from http://spamassassin.apache.org/. Building from tar/zip file is usually as simple as:

        [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]

After installing SpamAssassin, you need to download and install the SpamAssassin ruleset using "sa-update". See the "Installing Rules" section below.

Please make sure to read this whole document before installing, especially the prerequisite information further down.

To install as non-root, see the directions below.

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

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

If you're using SunOS 4.1.x, see
http://wiki.spamassassin.org/w/BuildingOnSunOS4 for build tips.

Installing SpamAssassin for Personal Use (Not System-Wide)

These steps assume the following, so substitute as necessary:

Many more details of this process are at http://wiki.apache.org/spamassassin/SingleUserUnixInstall

  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=$HOME
        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. Install the SpamAssassin ruleset using "sa-update":

$HOME/bin/sa-update

See the "Installing Rules" section below if you do not wish to download the rules directly from the internet.

5. If you already use procmail, skip to step 7. If not, ensure procmail

is installed using "which procmail" or install it from www.procmail.org.

6. Create a .forward file in your home directory containing the below

lines

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

7. 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/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

Also, see the file procmailrc.example and http://wiki.apache.org/spamassassin/UsedViaProcmail

8. 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 a copy of the GTUBE test string to check to be sure it is marked as spam. GTUBE is located in the sample-spam.txt message distributed with SpamAssassin and also at:

http://spamassassin.apache.org/gtube/

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.

Note: one possible cause for this is the use of smrsh on the MTA system; see http://wiki.spamassassin.org/w/ProcmailVsSmrsh for details.

9. You can now customize SpamAssassin. See README for more information.

Installing Rules

Rules are normally installed by running a sa-update command. The version of sa-update program should match the version of SpamAssassin modules, so invoking sa-update should be performed only after installing or upgrading SpamAssassin code, not before.

Installing rules from network is done with a single command:

sa-update

This is normally run as root.

If you wish to install rules from downloaded files, rather than "live" from the latest online ruleset, here is how to do it.

Obtain all the following files:

Mail-SpamAssassin-rules-xxx.tgz
Mail-SpamAssassin-rules-xxx.tgz.asc Mail-SpamAssassin-rules-xxx.tgz.md5 Mail-SpamAssassin-rules-xxx.tgz.sha1 (where xxx may look something like '3.3.0-rc1.r893295')

Save them all to the current directory. Obtain a rules-signing public key:

curl -O http://spamassassin.apache.org/updates/GPG.KEY

Import the signing key to the SpamAssassin gpg keyring, so that the rules files can be verified safely:

sa-update --import GPG.KEY

Install rules from a compressed tar archive:

sa-update --install Mail-SpamAssassin-rules-xxx.tgz

Note that the ".tgz.asc", ".tgz.md5" and ".tgz.sha1" files all need to be in the same directory, otherwise sa-update will fail.

If the intended rules destination directory differs from a default location as assumed by sa-update and SpamAssassin, such as when running a content filter within a Unix jail or on an unusual installation, please supply the rules destination directory to sa-update through its option --updatedir, such as:

sa-update --updatedir /var/jail/var/db/spamassassin/3.003000

CPAN

Most of the modules listed below are available via the Comprehensive Perl Archive Network (CPAN, see http://www.cpan.org/ for more information). While each module is different, most can be installed via a few simple commands such as:

        $ perl -MCPAN -e shell
        cpan> o conf prerequisites_policy ask
        cpan> install Module::Name
        cpan> quit

If there are problems or questions regarding the installation any of the modules, please see the CPAN and relevant module's documentation for more information. We can't provide documentation or installation support for third party modules.

Additional information about the CPAN module is also available via "perldoc CPAN".

Most Linux distributions also offer the CPAN modules in their own native formats (RPMs, Debian packages, etc.), so you should be able to find these through those mechanisms, too, if you prefer.

Required Perl Interpreter

Perl 5.8.1 or a later version is required. Preferred versions are 5.8.8, or 5.10.1 or later.

Most of the functions might still work with Perl 5.6.1 or 5.6.2, but 5.6.* is no longer a supported version.

Required Perl Modules

In addition to the modules associated with Perl, some additional modules need to be installed or upgraded depending on the version of Perl that you are running.

You can get an immediate report on which of these modules you may need (or want) to upgrade, by running "perl build/check_dependencies" from the SpamAssassin build directory.

The list of required modules that do not ship with Perl and must be installed:

Debian/Ubuntu: apt-get install libnet-dns-perl Fedora: yum install perl-Net-DNS

Optional Modules

In addition, the following modules will be used for some checks, if available and the version is high enough. If they are not available or if their version is too low, SpamAssassin will still work, just not as effectively because some of the spam-detection tests will have to be skipped.

Note: SpamAssassin will not warn you if these are installed, but the version is too low for them to be used.

Note that the Mail::DKIM module in turn requires the Digest::SHA module and OpenSSL libraries.

What Next?

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

The SpamAssassin Wiki <http://wiki.spamassassin.org/> contains information on custom plugins, extensions, and other optional modules included with SpamAssassin.

(end of INSTALL)

// vim:tw=74: