Jump to content

Zimbra Mail Sending Policy

From TetraWiki
Revision as of 13:52, 7 June 2015 by Amit (talk | contribs) (Created page with "<center><u>'''''Zimbra Mail Sending Policy'''''</u></center> === Defining a rate-limit (quota) with cbpolicyd === By default "quota" or "rate limiting" is enabled, but ther...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Zimbra Mail Sending Policy


Defining a rate-limit (quota) with cbpolicyd

By default "quota" or "rate limiting" is enabled, but there is no policy defining how it should behave. The below example adds two policies:

  • Rate limit any sender from sending more then 20 emails every 60 seconds. Messages beyond this limit are deferred.


As Zimbra:

  • Create a file called rate-limit.sql with the following contents. Note: these two quotas entries will get added as QuotasID 3 and 4, because there are two entries already in the default quotas table, as shown above:
BEGIN TRANSACTION;
INSERT INTO "quotas" (PolicyID,Name,Track,Period,Verdict,Data) VALUES (6, 'Sender:user@domain','Sender:user@domain', 60, 'DEFER', 'Deferring: Too many messages from sender in last 60');
INSERT INTO "quotas_limits" (QuotasID,Type,CounterLimit) VALUES(3, 'MessageCount', 20);
COMMIT;
  • Import the rules into cbpolicyd:
sqlite3 /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb < rate-limit.sql