Zimbra Mail Sending Policy: Difference between revisions
Appearance
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..." |
No edit summary |
||
| Line 1: | Line 1: | ||
[[category:Heromotocorp Biz]] | |||
[[category:Tetra Clients]] | |||
<center><u>'''''Zimbra Mail Sending Policy'''''</u></center> | <center><u>'''''Zimbra Mail Sending Policy'''''</u></center> | ||
Revision as of 13:57, 7 June 2015
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