-
Notifications
You must be signed in to change notification settings - Fork 73
/
INSTALL
350 lines (228 loc) · 10.9 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
Upgrading SpamAssassin?
-----------------------
Please be sure to read the UPGRADE file for important changes that
have been made since previous versions.
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]
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 UPGRADES. 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.
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
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. 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/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
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 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.
8. You can now customize SpamAssassin. See README for more information.
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.6.1 or a later version is required.
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:
- Digest::SHA1 (from CPAN)
The Digest::SHA1 module is used as a cryptographic hash for some
tests and the Bayes subsystem.
Debian: apt-get install libdigest-sha1-perl
Gentoo: emerge dev-perl/Digest-SHA1
- HTML::Parser >= 3.24 (from CPAN)
Version 3.31 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.
Debian: apt-get install libhtml-parser-perl
Gentoo: emerge dev-perl/HTML-Parser
- Storable (from CPAN)
This is a required module if you use spamd and allow children to
handle more than one client connection before quitting. Third party
utilities may also require this module for the same functionality.
Storable is used to shift configuration when a spamd process switches
between users.
If you plan to run SpamAssassin on a multiprocessor machine, or one
with a hyperthreaded CPU like a Pentium 4, it is strongly recommended
that you ensure version 2.12 (or newer) is installed. This fixes a
bug that causes hangs under heavy load with that hardware
configuration. (The fix might also be in version 2.10 already,
see <http://bugzilla.spamassassin.org/show_bug.cgi?id=4010> for more
information.)
Debian: apt-get install libstorable-perl
Gentoo: emerge dev-perl/Storable
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.
- MIME::Base64
This module is highly recommended to increase the speed with which
Base64 encoded messages/mail parts are decoded.
- DB_File (from CPAN, included in many distributions)
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.
There seems to be a bug in libdb 4.1.25, which is
distributed by default on some versions of Linux. See
http://wiki.apache.org/spamassassin/DbFileSleepBug for details.
- Net::DNS (from CPAN)
Used for all DNS-based tests (SBL, XBL, SpamCop, DSBL, etc.),
perform MX checks, used when manually reporting spam to SpamCop,
and used by sa-update to gather version information. Recommended.
If this is installed and you are using network tests of any variety
(which is the default), then you need to make sure the Net::DNS
version is sufficiently up-to-date:
- version 0.34 or higher on Unix systems
- version 0.46 or higher on Windows systems
- Net::SMTP (from CPAN)
Used when manually reporting spam to SpamCop.
- Mail::SPF::Query (from CPAN)
Used to check DNS Sender Policy Framework (SPF) records to fight email
address forgery and make it easier to identify spams.
Net::DNS version 0.34 or higher is required to use Mail::SPF::Query.
- IP::Country::Fast (from CPAN)
Used by the RelayCountry plugin (not enabled by default) to determine
the domain country codes of each relay in the path of an email.
- 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.)
- Time::HiRes (from CPAN)
If this module is installed, the processing times are logged/reported
more precisely.
- DBI *and* DBD driver/modules for your database (from CPAN)
If you intend to use SpamAssassin with an SQL database backend for
user configuration data, Bayes storage, or other storage, you will need
to have these installed; both the basic DBI module and the driver for
your database.
- LWP (from CPAN)
Used by sa-update to retrieve update archives.
- IO::Zlib (from CPAN)
Used by sa-update to uncompress update archives.
- Archive::Tar (from CPAN)
Used by sa-update to expand update archives.
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: