In this Blog post, I’ll try to explain how to install Policyd(Cluebringer) add-on for Postfix.
Policyd is a good tool fighting with outbound spam mails. Also, it is a lightweight system that is not used so much system resources. It has so many abilities like greylisting, quota outbound mails, SPF check.
What we need to install
- A mail server with Postfix installed
- This post based on Debian-oriented systems. You can use also fo other distributions but there will be some changes while installing.
Table of Contents
1 Installation
I’ll use apt-get to install some elements of Policyd
1 |
apt-get install postfix-cluebringer |
1.1 Installing some requirements for Policyd
- Policyd uses some Perl modules so let’s install these.
NOTE maybe some modules installed by apt-get so if it not necessary go next
- MySQL, PostgreSQL or SQLite
1 |
apt-get install mysql-server mysql-client |
- Net::Server >= 0.96
1 |
/usr/bin/perl -MCPAN -e 'install Net::Server' |
- Net::CIDR
1 |
/usr/bin/perl -MCPAN -e 'install Net::CIDR' |
- Config::IniFiles (debian: libconfig-inifiles-perl, rpm: perl-Config-IniFiles)
1 |
apt-get install libconfig-inifiles-perl |
- Cache::FastmMap (debian: libcache-fastmmap-perl, rpm: perl-Cache-FastMmap)
1 |
apt-get install libcache-fastmmap-perl |
- Mail::SPF (required for CheckSPF module)
1 |
/usr/bin/perl -MCPAN -e 'install Mail::SPF ' |
1.2 To create mysql environment for Policyd
- Policyd compatible with MySQL, PostgreSQL or SQLite. I choose Mysql for keeping datas. Documentation on official Website is out of date. Installing from there is not possible because of that I did some changes while creating a database. For these changes please follow the instruction.
1 2 3 4 5 6 7 8 9 10 11 |
cd mkdir policyd-cluebringer cd policyd-cluebringer wget http://download.policyd.org/v2.0.14/cluebringer-v2.0.14.tar.xz unxz -c clue* | tar xv cd clue* cd database for i in core.tsql accesscontrol.tsql quotas.tsql amavis.tsql checkhelo.tsql checkspf.tsql greylisting.tsql do ./convert-tsql mysql55 $i done > policyd.mysql |
Note if this for loop does not work well you have to learn your mysql version and you have to change mysql55 like mysqlXX
1 2 |
mysql –version mysql Ver 14.14 Distrib 5.5.44, for debian-linux-gnu (x8664) using readline 6.3 |
1.3 Cluebringer-webui Configuration
- In this part we are going to configure web interface of Cluebringer
- Edit cluebringer.webui
1 |
nano /etc/cluebringer/cluebringer-webui.conf |
1 2 3 |
$DB_DSN="mysql:host=localhost;dbname=cluebringer"; $DB_USER="cluebringer"; $DB_PASS="mypassword"; |
- Link for Apache2
1 2 |
cd var/www/html ln -s /usr/share/postfix-cluebringer-webui/webui |
1.3.1 Installing Php5 mysql drivers
- Last step
1 |
apt-get install php5-mysql |
- Now you can browse <http://IP/webui>
If you want to continue for more configurations for Policyd you can check with sources links
2 Sources
- http://uname.pingveno.net/blog/index.php/post/2015/03/11/Configure-sender-rate-limits-to-prevent-spam,-using-cluebringer-(policyd)-with-Postfix
- http://wiki.policyd.org/requirements
- http://wiki.policyd.org/installing
- http://www.kutukupret.com/2009/09/13/postfix-centos-policyd-v2-mysql/
- http://ngocquyetlinux.blogspot.com.tr/2013/05/limit-mail-with-policyd.html
- https://help.ubuntu.com/community/Postfix/SPF
- http://imanudin.net/2014/09/08/how-to-install-policyd-on-zimbra-8-5/
- https://wiki.zimbra.com/wiki/Postfix_Policyd