Zimbra Mail Sending Policy: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 22: | Line 22: | ||
sqlite3 /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb < rate-limit.sql | sqlite3 /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb < rate-limit.sql | ||
Name : Delivery Per User | |||
Track : Select Sender@domain. This means that policy will be applies to each user on the domain | |||
Period : The length of time that given in seconds. Ideally is in counts per hour or 3600 seconds | |||
Link to policy : Select Default | |||
Verdict : The rules that will be apply if it meets the period, such as defer (hold the messages until next time interval) | |||
Data : Information that is given if it meets the rule, for example the information is a “Maximum 2 email delivery per minute” or “Maximum 300 emails delivery per hour” | |||
Stop processing here : choose Yes, means that rule will not processing another rule | |||
Comment : can be filled with anything you like | |||
Revision as of 09:02, 8 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
Name : Delivery Per User Track : Select Sender@domain. This means that policy will be applies to each user on the domain Period : The length of time that given in seconds. Ideally is in counts per hour or 3600 seconds Link to policy : Select Default Verdict : The rules that will be apply if it meets the period, such as defer (hold the messages until next time interval) Data : Information that is given if it meets the rule, for example the information is a “Maximum 2 email delivery per minute” or “Maximum 300 emails delivery per hour” Stop processing here : choose Yes, means that rule will not processing another rule Comment : can be filled with anything you like