On 04/05/11 21:02, Robert Anderson wrote:
Hi Juan,

Thanks for addressing the issue, also I would like to place a feature
request:

Is is posible to have a RCPT Counter limit type in the quotas module?,
same feature in the old policydv1.

I want to avoid users send few messages with 1000 recipients each. I
know that postfix features smtpd_recipient_limit, but does not have a
way to throttle in time frames like policyd does.

Could you try the attached patch and let us know how it goes?

Please also note that this will change the behaviour of the message size
counters and the database will need to be modified.

The following commands should help you:

UPDATE quotas_limits, quotas_tracking
SET quotas_limits.CounterLimit = ceil(quotas_limits.CounterLimit / 1024),
quotas_tracking.Counter = ceil(quotas_tracking.Counter / 1024)
WHERE quotas_tracking.QuotasLimitsID = quotas_limits.ID
AND quotas_limits.Type = "MessageCumulativeSize";

UPDATE session_tracking SET Size = ceil(Size / 1024);

Let us know if you run into any problems.

Robert


Hi Robert, just tested the patch in 2.0.10, since I am using a debian testing package.

It worked fine, I reverted the quotas_tracking.Counter to decimal(10.4).

I used the attached script to test.


May 9 01:03:01 juan cbpolicyd[2388]: module=Quotas, mode=create, host=10.0.0.8, helo=[192.168.0.37], [email protected], [email protected], reason=quota_create, policy=6, quota=3, limit=4, track=SASLUsername:[email protected], counter=MessageCount, quota=1/20 (5.0%) May 9 01:03:01 juan cbpolicyd[2388]: module=Quotas, mode=create, host=10.0.0.8, helo=[192.168.0.37], [email protected], [email protected], reason=quota_create, policy=6, quota=3, limit=5, track=SASLUsername:[email protected], counter=MessageCumulativeSize, quota=0/51200 (0.0%) May 9 01:03:02 juan cbpolicyd[18869]: module=Quotas, mode=update, host=10.0.0.8, helo=[192.168.0.37], [email protected], [email protected], reason=quota_update, policy=6, quota=3, limit=5, track=SASLUsername:[email protected], counter=MessageCumulativeSize, quota=1/51200 (0.0%) May 9 01:03:26 juan cbpolicyd[316]: module=Quotas, mode=update, host=10.0.0.8, helo=[192.168.0.37], [email protected], [email protected], reason=quota_update, policy=6, quota=3, limit=4, track=SASLUsername:[email protected], counter=MessageCount, quota=1/20 (5.0%) May 9 01:03:26 juan cbpolicyd[316]: module=Quotas, mode=update, host=10.0.0.8, helo=[192.168.0.37], [email protected], [email protected], reason=quota_update, policy=6, quota=3, limit=5, track=SASLUsername:[email protected], counter=MessageCumulativeSize, quota=1/51200 (0.0%) May 9 01:03:27 juan cbpolicyd[972]: module=Quotas, mode=update, host=10.0.0.8, helo=[192.168.0.37], [email protected], [email protected], reason=quota_update, policy=6, quota=3, limit=5, track=SASLUsername:[email protected], counter=MessageCumulativeSize, quota=58595/51200 (114.4%)


Regards.

Juan.-
http://launchtime.ri.mu - VPS hosting
http://ri.mu - monitoring, DNS, FTP, helpdesk software and more

Attachment: test-cluebringer.sh
Description: Bourne shell script

_______________________________________________
Users mailing list
[email protected]
http://lists.policyd.org/mailman/listinfo/users

Reply via email to