INSTALL 2.29 KB
Newer Older
Nigel Kukard's avatar
Nigel Kukard committed
1
2
3
Installing Policyd v2.


Nigel Kukard's avatar
Nigel Kukard committed
4
* Requirements for Policyd v2
5
- MySQL or PostgreSQL or SQLite
Nigel Kukard's avatar
Nigel Kukard committed
6
7
- Net::Server >= 0.96
- Net::CIDR
Nigel Kukard's avatar
Nigel Kukard committed
8
9
- Config::IniFiles (Debian based: libconfig-inifiles-perl, RPM based: perl-Config-IniFiles)
- Cache::FastMmap (Debian based: libcache-fastmmap-perl, RPM based: perl-Cache-FastMmap)
10
- Mail::SPF (Required for CheckSPF module)
Nigel Kukard's avatar
Nigel Kukard committed
11

12
* Requirements for webui
13
- PHP v5+ (compiled with PDO support for your DB)
Nigel Kukard's avatar
Nigel Kukard committed
14
15


16
17


Nigel Kukard's avatar
Nigel Kukard committed
18
19
20
1. Setup MySQL  (or whichever database you plan to use)

a. In database/ run...
21
$ for i in  core.tsql access_control.tsql quotas.tsql amavis.tsql checkhelo.tsql checkspf.tsql greylisting.tsql
Nigel Kukard's avatar
Nigel Kukard committed
22
23
24
25
$ do 
$        ./convert-tsql mysql $i
$ done > policyd.mysql

26
27
28
This will build policyd.mysql, be sure to ALWAYS load core.tsql first, you only really need the
schema for the modules you plan to use, no harm in adding all of them though.

Nigel Kukard's avatar
Nigel Kukard committed
29
b. Load policyd.mysql into MySQL
30
$ mysql -u root -p policyd < policyd.mysql
Nigel Kukard's avatar
Nigel Kukard committed
31
32


33
2. Put cluebringer.conf in your /etc directory and adjust cluebringer.conf with your MySQL database details
Nigel Kukard's avatar
Nigel Kukard committed
34
35
36
37
38
39
40


3. Copy the cbp/ directory into /usr/local/lib/policyd-2.0/
mkdir /usr/local/lib/policyd-2.0
cp -r cbp /usr/local/lib/policyd-2.0/

4. Copy cbpolicyd and cbpadmin into /usr/local/bin
41
42
cp cbpadmin /usr/local/bin/
cp cbpolicyd /usr/local/sbin/
Nigel Kukard's avatar
Nigel Kukard committed
43
44


Nigel Kukard's avatar
Nigel Kukard committed
45
5. Install the webui/*  into your apache directory, check out   includes/config.php  and adjust the MySQL server details.
Nigel Kukard's avatar
Nigel Kukard committed
46
47


Nigel Kukard's avatar
Nigel Kukard committed
48
6. Setup Postfix to use cbpolicyd...
Nigel Kukard's avatar
Nigel Kukard committed
49
50
51
52
53
Add the following Postfix config...
	check_policy_service inet:127.0.0.1:10031
in BOTH  smtpd_recipient_restrictions and smtpd_end_of_data_restrictions.


54
55
56

** Optional Amavisd Supprt ***

Nigel Kukard's avatar
Nigel Kukard committed
57
7. Copy your amavisd from /usr/sbin/amavisd and patch it with contrib/amavisd-new-2.5.3_policyd-200802070918.patch like this...
Nigel Kukard's avatar
Nigel Kukard committed
58
59
60
$ patch < contrib/amavisd-new-2.5.3_policyd-200802070918.patch
After this change your initscripts to start the patched amavisd.

Nigel Kukard's avatar
Nigel Kukard committed
61
8. Copy amavisd-policyd.pm where you see fit, and add this configuration line to your amavisd.conf file...
Nigel Kukard's avatar
Nigel Kukard committed
62
63
include_config_files('/path/to/amavisd-policyd.pm');

Nigel Kukard's avatar
Nigel Kukard committed
64
9. Edit the top of amavisd-policyd.pm and change ...
Nigel Kukard's avatar
Nigel Kukard committed
65
66
use lib('/root/cluebringer-trunk');  # to point to the directory which contains cbp/

67
my $DB_dsn = "DBI:mysql:database=policyd;host=localhost";  # to point to your MySQL DB
Nigel Kukard's avatar
Nigel Kukard committed
68

Nigel Kukard's avatar
Nigel Kukard committed
69

Nigel Kukard's avatar
Nigel Kukard committed
70
10. Fire everything up and browse to the web gui to configure