Installing Policyd v2.


* Requirements for Policyd v2
- MySQL or PostgreSQL or SQLite
- Net::Server >= 0.96
- Net::CIDR
- Config::IniFiles (Debian based: libconfig-inifiles-perl, RPM based: perl-Config-IniFiles)
- Cache::FastMmap (Debian based: libcache-fastmmap-perl, RPM based: perl-Cache-FastMmap)
- Mail::SPF (Required for CheckSPF module)

* 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
$ 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 directory and adjust cluebringer.conf with your MySQL database details


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
cp cbpadmin /usr/local/bin/
cp cbpolicyd /usr/local/sbin/


5. Install the webui/*  into your apache directory, check out   includes/config.php  and adjust the MySQL server details.


6. 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 ***

7. 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.

8. 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');

9. 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


10. Fire everything up and browse to the web gui to configure
