Hello good people, in today’s post we’ll have a look at how to install and get cbpolicy up and running on CentOS 7.x. We’ll cover installing Mariadb server the setting up policyd.

Install software deps:

Fire these commands on the terminal:

yum install -y mariadb mariadb-server  perl-Cache-FastMmap perl-Config-IniFiles
systemctl enable mariadb
systemctl start mariadb

Download and install policyd rpm package

wget https://download.policyd.org/v2.0.14/cluebringer-2.0.14-1.noarch.rpm
rpm -ivh cluebringer-2.0.14-1.noarch.rpm

Download cbpolicy source files for setting up db

wget https://download.policyd.org/v2.0.14/cluebringer-v2.0.14.zip
unzip cluebringer-v2.0.14.zip
cd cluebringer-v2.0.14
cd database

In database/ run the following:

for i in core.tsql access_control.tsql quotas.tsql amavis.tsql checkhelo.tsql checkspf.tsql greylisting.tsql accounting.tsql; 
./convert-tsql mysql $i
done > policyd.sql

Now Create policyd database

mysqladmin -u root -p create policyd

Load policyd.mysql into your database, in this case MySQL:

sed -i 's/TYPE=InnoDB CHARACTER SET latin1 COLLATE latin1_bin//' policyd.sql
mysql -u root -ppassword policyd < policyd.sql

Configure cbpolicyd database

sed -i 's/#Username=root/Username=root/'  /etc/policyd/cluebringer.conf
sed -i 's/#Password=/Password=Password'  /etc/policyd/cluebringer.conf

To setup cbpolicy UI,install the webui/* into your apache directory, check out includes/config.phpand adjust the database details.

Setup Postfix to use cbpolicyd.

Add the following Postfix config setting in BOTH smtpd_recipient_restrictions and smtpd_end_of_data_restrictions:

check_policy_service inet:

It’s recommended to add these parameters first, i.e.:

smtpd_recipient_restrictions = check_policy_service inet:, permit_mynetworks, ..., ...



I also made Postfix administration cheat sheet which you can read from the link provided here.

Postfix Commands Administration Cheat Sheet

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here