-
Notifications
You must be signed in to change notification settings - Fork 9
/
INSTALL
177 lines (114 loc) · 5.09 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
Online Documentation
--------------------
Most of the Spamikaze documentation should be present online by now,
at http://spamikaze.org/ This document gives some extra
hints and hints on how to upgrade from the previous version.
Packages
--------
On Fedora or CentOS systems, the following packages should
be installed:
database:
yum install postgresql-server postgresql or
yum install mariadb-server mariadb
spamikaze dependencies:
yum install perl perl-DBI perl-Net-DNS perl-Config-IniFiles perl-CGI
yum install perl-DBD-MySQL perl-DBD-Pg
PostgreSQL
----------
The PostgreSQL database schema is more efficient than the ones
currently available for MySQL. PostgreSQL also seems to be better at
handling large queries while other transactions are happening. This
makes PostgreSQL the recommended database for Spamikaze.
MySQL
-----
Important. If you are updating from the previous version of Spamikaze
the please read the following. If not then move on to the install part
of this document.
Update Spamikaze
----------------
To update from the Spamikaze version .1 you will need three extra
tables in the spamikaze database. This is simply done by importing
the update dump in mysql.
mysql -u root -p spamikaze < spamikaze-mysql-update.sql
Next you need to make sure you have a backup of your current database
before you run the update script which is located in the scripts
directory. This update will import the current entries which are all
stored in the spammers table into the ipnumber and ipentries tables.
Install Spamikaze
-----------------
We are assuming you already have mysql installed and running. If not
then please get a version for your OS and install it with the guide-
lines of that package.
* Creating a new database for spamikaze:
At the prompt you can use mysqladmin to create a new database.
mysqladmin -u root -p create spamikaze
You will be prompted for the mysql root password, enter it. If no
errors are shown you need to login as mysql root to the database
server in order to grant privileges to the new spamikaze directory:
mysql -u root -p mysql
Again you will be prompted for a password, enter it.
Once you are in you should grant privileges with to a user at either
localhost or a webserver able to access this mysql server. It is not
recommended to use a remote server without using some sort of encryption.
The following example will use user spamikaze at localhost. You need to
grant select, insert and update privileges at least. It is recommended
to hold back any other privileges at this time:
mysql> GRANT SELECT, INSERT, UPDATE ON spamikaze.* TO
spamikaze@localhost IDENTIFIED BY 's0m3leetpassw0rd';
Once this is done you only need to flush the privileges:
mysql> FLUSH PRIVILEGES;
The last thing to do with mysql is read the spamikaze.sql into the newly
created database.
mysql -u root -p spamikaze < /path/spamikaze-mysql.sql
Again you will be prompted for a password, enter it.
Webserver
---------
The most common webserver around for the *nix platform is Apache. To run
either the cgi or the php 4 scripts you will have to make sure apache can
handle them.
The php scripts are using the newly introduced superglobals and can be run
with register_globals set off:
http://nl3.php.net/manual/en/language.variables.predefined.php
For installation guides on both Apache and PHP please see the following url's:
http://nl3.php.net/manual/en/installation.php
http://httpd.apache.org/
Spamikaze
---------
Setting up the scripts:
The first thing you need to do is check the location of the perl shebang.
Spamikaze uses #!/usr/bin/perl. If it isn't located there you will either
have to links perl to that location or alter the shebangs in all the perl
scripts. For the php files you will use you will need to edit the
include_once location to point it to the correct config.php.
Next choose a location where the scripts could be located on your system.
Copy config.php, passivetrap.pl, sendmail.pl and named.pl to that location.
Store the php/cgi scripts in your webdir/cgi-bin.
Mail and Database Scripts
-------------------------
Please check the online documentation:
http://spamikaze.org/
Almost done, setting up the spamtraps and cronjobs:
a. Setting up spamtraps using aliases in your /etc/aliases by piping them
to passivetrap.pl. An example:
passive: |/path/passivetrap.pl
nomailwanted: passive
MUNGED: passive
uns: passive
Once you run newaliases it will use passivetrap to handle all incoming mail.
Importing older spam:
---------------------
With formail you can import your current spamarchive into the database server:
formail -s /path/passivetrap.pl < /path/spamarchive
On older machines it might take a long time, depending on the number of
spams and your hardware.
If you wish to import mail from different files then the following shellcode
will enable you to do it:
for I in *
do
formail -s /path/passivetrap.pl < $I
done
Be aware that importing single testentries located in mbox files without
using formail will trigger the mailer daemon notification and will not
import the ipaddress
Enjoy,
The Spamikaze team.