本文介绍在CentOS 7系统上安装和运行cbpolicyd的方法,将介绍安装Mariadb服务器设置policyd。
安装软件deps 在终端上输入这些命令: yum install -y mariadb mariadb-server perl-Cache-FastMmap perl-Config-IniFiles systemctl enable mariadb systemctl start mariadb
下载并安装policyd rpm软件包 wget https://download.policyd.org/v2.0.14/cluebringer-2.0.14-1.noarch.rpm rpm -ivh cluebringer-2.0.14-1.noarch.rpm
下载用于设置db的cbpolicy源文件 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 在数据库/运行以下内容: 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.sql 现在创建policyd数据库: mysqladmin -u root -p create policyd 将policyd.mysql加载到你的数据库中,在本例中为MySQL: sed -i 's/TYPE=InnoDB CHARACTER SET latin1 COLLATE latin1_bin//' policyd.sql mysql -u root -ppassword policyd < policyd.sql
配置cbpolicyd数据库 sed -i 's/#Username=root/Username=root/' /etc/policyd/cluebringer.conf sed -i 's/#Password=/Password=Password' /etc/policyd/cluebringer.conf 要设置cbpolicy UI,请将webui/*安装到你的apache目录中,查看includes/config.php并调整数据库详细信息。
设置Postfix以使用cbpolicyd 在BOTH smtpd_recipient_restrictions和smtpd_end_of_data_restrictions中添加以下Postfix配置设置: check_policy_service inet:127.0.0.1:10031 建议首先添加这些参数,即: smtpd_recipient_restrictions = check_policy_service inet:127.0.0.1:10031, permit_mynetworks, ..., ... 参考如下图:
相关主题 |