Zimbra and Postfix Policyd (cbpolicyd)

I was looking for a way to throttle the number of emails sent / received per account per hour on Zimbra servers. After a little digging around, I stumbled upon cbpolicyd, which ships with Zimbra and seems to be designed exactly for a task like this.

While Zimbra has pretty good documentation on getting cbpolicyd up and running, getting my head wrapped around cbpolicyd itself took a bit longer than I would have liked. To help visualize how cbpolicyd is structured internally, I decided to create a schema diagram of the tables.

First, I copied the database to /tmp/

cp /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb /tmp/

Then I dumped the schema out to a file

sqlite3 /tmp/cbpolicyd.sqlitedb .sch > /tmp/schema

Finally, I imported the schema into MySQL, and used MySQL Workbench to create the schema. Here is the exported schema and the workbench file. The diagram is shown below: