Huu Phan | Blog Linux operating system | Linux operating system -Blog Huu Phan | Powered by Blogger.

zimbra 8.6 cbpolicyd example

zimbra cbpolicyd example

Links to below you maybe likes:
How to zimbra enforce spf checking for incomming email

How to use cbpolicyd to configure 120 message from sender in last 30s.
in order configure in zimbra cbpolicyd
policies -->policy_members -->quotas -->quotas_limits

To create zimbra-example.sql file
INSERT INTO "policies" (ID,Name,Priority,Description) VALUES(6,'Example CBPolicyd Policies', 0, 'Example CBPolicyd Policies');
INSERT INTO "policy_members" (ID,PolicyID,Source,Destination) VALUES(10,6, '[email protected]', '!%internal_domains');
INSERT INTO "quotas" (ID,PolicyID,Name,Track,Period,Verdict,Data) VALUES (14,10, 'Sender:[email protected]','Sender:[email protected]', 30, 'REJECT', 'Rejected from CBPolicyd: Too many messages from sender in last 30s');
INSERT INTO "quotas_limits" (ID,QuotasID,Type,CounterLimit) VALUES(16,14, 'MessageCount', 120);

To import zimbra-example.sql file into cbpolicyd.sqlitedb
su - zimbra
cd /opt/zimbra/data/cbpolicyd/db
sqlite3 /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb < zimbra-example.sql
zmmtactl restart
zmcbpolicydctl restart

To check rules zimbra cbpolicyd
su - zimbra
cd /opt/zimbra/data/cbpolicyd/db
sqlite3 cbpolicyd.sqlitedb
sqlite> select * from policies;
sqlite> select * from policy_members;
sqlite> select * from quotas;
sqlite> select * from quotas_limits;

How to update "quotas_limits" 60 messages count. we are create zimbra-update.sql as bellow
delete from quotas_limits where ID=16;
INSERT INTO "quotas_limits" (ID,QuotasID,Type,CounterLimit) VALUES(16,14, 'MessageCount', 60);

After, import databases and cbpolicyd restart.
sqlite3 /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb < zimbra-update.sql
zmcbpolicydctl restart

To check log of zimbra cbpolicyd
tailf /opt/zimbra/log/cbpolicyd.log | egrep ERROR
tailf /opt/zimbra/log/cbpolicyd.log

zimbra 8.6 cbpolicyd easy example. Thanks you reading!

post new :

Huu Phan | Blog Linux operating system | Huu Phan ~ Zimbra Mail Server,linux,bash script,centos,linux command |