Mail-SpamAssassin

 view release on metacpan or  search on metacpan

INSTALL  view on Meta::CPAN

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
https://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:

     https://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 https://wiki.apache.org/spamassassin/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

For security reasons, it should not be run as root, but as the user normally
running SpamAssassin.  You can run the initial setup once as root, to create
necessary directories etc.  Then you need to change ownership of
LOCAL_STATE_DIR to that user (usually: chown -R user:user
/var/lib/spamassassin), you can find out the default directory with
sa-update --help (look for --updatedir).  Same needs to be done for
LOCAL_RULES_DIR/sa-update-keys (usually: chown -R user:user
/etc/mail/spamassassin/sa-update-keys), the directory can be found with
spamassassin --help (look for --siteconfigpath).

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 from https://spamassassin.apache.org/downloads.cgi:

    Mail-SpamAssassin-rules-xxx.tgz
    Mail-SpamAssassin-rules-xxx.tgz.asc
    Mail-SpamAssassin-rules-xxx.tgz.sha512
      (where xxx may look something like '4.0.0.r1900144')

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

    curl -O https://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", ".tgz.asc" and ".tgz.sha512" 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 https://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".



( run in 0.713 second using v1.01-cache-2.11-cpan-71847e10f99 )