-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL
114 lines (73 loc) · 3.12 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
Installing PolicyD v2.
*
* Requirements for PolicyD v2
*
Note: For CentOS you will need to use RPMForge repositories.
- MySQL or PostgreSQL or SQLite
Debian based: mysql-server
RPM based: mysql-server
- Net::Server >= 0.96
Debian based: libnet-server-perl
RPM based: perl-Net-Server
- Net::CIDR
Debian based: libnet-cidr-perl
RPM based: perl-Net-CIDR
- Net::DNS
Debian based: libnet-dns-perl
RPM based: perl-Net-DNS
- Config::IniFiles
Debian based: libconfig-inifiles-perl
RPM based: perl-Config-IniFiles
- Cache::FastMmap
Debian based: libcache-fastmmap-perl
RPM based: perl-Cache-FastMmap
- DBI
Debian based: libdbi-perl
RPM based: perl-DBI
- Mail::SPF (Required for CheckSPF module)
Debian based: libmail-spf-perl
- Date::Parse (TimeDate)
Debian based: libtimedate-perl
RPM based: perl-TimeDate
* Requirements for webui
- PHP v5+ (compiled with PDO support for your DB)
1. Setup MySQL (or whichever database you plan to use)
a. In database/ run...
$ for i in core.tsql access_control.tsql quotas.tsql amavis.tsql checkhelo.tsql checkspf.tsql greylisting.tsql accounting.tsql
$ do
$ ./convert-tsql mysql $i
$ done > policyd.mysql
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.
b. Load policyd.mysql into MySQL
$ mysql -u root -p policyd < policyd.mysql
2. Put cluebringer.conf in your /etc/cbpolicyd directory and adjust cluebringer.conf with your MySQL database details
mkdir /etc/cbpolicyd
cp cluebringer.conf /etc/cbpolicyd/cluebringer.conf
3. Copy the cbp/ & awitpt/ directories into /usr/local/lib/cbpolicyd-2.1/
mkdir /usr/local/lib/cbpolicyd-2.1
cp -r cbp /usr/local/lib/cbpolicyd-2.1/
cp -r awitpt/awitpt /usr/local/lib/cbpolicyd-2.1/
4. Copy cbpolicyd and cbpadmin into /usr/local/bin
cp cbpadmin /usr/local/bin/
cp cbpolicyd /usr/local/sbin/
5. Setup system dirs ...
mkdir /var/log/cbpolicyd
mkdir /var/run/cbpolicyd
If you are running cbpolicyd as an unpriv user, then ...
chown cbpolicyd.cbpolicyd /var/log/cbpolicyd /var/run/cbpolicyd
6. Install the webui/* into your apache directory, check out includes/config.php and adjust the MySQL server details.
7. Setup Postfix to use cbpolicyd...
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.
** Optional Amavisd Supprt ***
8. Copy your amavisd from /usr/sbin/amavisd and patch it with contrib/amavisd-new-2.5.3_policyd-200802070918.patch like this...
$ patch < contrib/amavisd-new-2.5.3_policyd-200802070918.patch
After this change your initscripts to start the patched amavisd.
9. Copy amavisd-policyd.pm where you see fit, and add this configuration line to your amavisd.conf file...
include_config_files('/path/to/amavisd-policyd.pm');
10. Edit the top of amavisd-policyd.pm and change ...
use lib('/root/cluebringer-trunk'); # to point to the directory which contains cbp/
my $DB_dsn = "DBI:mysql:database=policyd;host=localhost"; # to point to your MySQL DB
11. Fire everything up and browse to the web gui to configure