On 08/01/11 19:59, Osmany Goderich wrote: > Why on earth is your period 0 ? > > Bandwidth goes pretty fast in 0 seconds, the next second you get the same > amount of bandwidth... > > Set the period to the amount of time you want the user to use that amount of > bandwidth in. > > > Ok. So I've successfully made the policy work but I don't quite understand > where does it get the numbers from, this is what I get in my logs I was > hoping if you can help me figure it out: > > Aug 1 15:39:35 tauro cbpolicyd[72820]: module=Quotas, mode=update, > host=10.25.80.8, helo=mail.domain.com, [email protected], > [email protected], reason=quota_update, policy=5, quota=3, limit=4, > track=Sender:[email protected], counter=MessageCumulativeSize, > quota=501111/1000000 (50.1%) > Aug 1 15:39:45 tauro cbpolicyd[74013]: module=Quotas, mode=update, > host=10.25.80.8, helo=mail.domain.com, [email protected], > [email protected], reason=quota_update, policy=5, quota=3, limit=4, > track=Sender:[email protected], counter=MessageCumulativeSize, > quota=2831567/1000000 (283.2%) > Aug 1 15:39:45 tauro postfix/qmgr[45088]: 35F3FB8AA: > from=<[email protected]>, size=2330637, nrcpt=1 (queue active) > Aug 1 15:39:48 tauro postfix/qmgr[45088]: 14DAAB870: > from=<[email protected]>, size=2331082, nrcpt=1 (queue active) > Aug 1 15:39:48 tauro amavis[74309]: (74309-08) Passed CLEAN, [10.25.80.8] > [10.25.80.8] <[email protected]> -> <[email protected]>, Message-ID: > <[email protected]>, mail_id: q64cW2B8mmZk, Hits: > -2.899, size: 2330637, queued_as: 14DAAB870, 2632 ms > Aug 1 15:40:33 tauro cbpolicyd[74013]: module=Quotas, mode=update, > host=10.25.80.8, helo=mail.domain.com, [email protected], > [email protected], reason=quota_update, policy=5, quota=3, limit=4, > track=Sender:[email protected], counter=MessageCumulativeSize, > quota=986667/1000000 (98.7%) > Aug 1 15:40:43 tauro cbpolicyd[74013]: module=Quotas, mode=update, > host=10.25.80.8, helo=mail.domain.com, [email protected], > [email protected], reason=quota_update, policy=5, quota=3, limit=4, > track=Sender:[email protected], counter=MessageCumulativeSize, > quota=3317123/1000000 (331.7%) > Aug 1 15:40:43 tauro postfix/qmgr[45088]: 7FA89B8AA: > from=<[email protected]>, size=2330637, nrcpt=1 (queue active) > Aug 1 15:40:47 tauro postfix/qmgr[45088]: CF19BB87B: > from=<[email protected]>, size=2331082, nrcpt=1 (queue active) > Aug 1 15:40:47 tauro amavis[74282]: (74282-18) Passed CLEAN, [10.25.80.8] > [10.25.80.8] <[email protected]> -> <[email protected]>, Message-ID: > <[email protected]>, mail_id: 5+4wzmVSR3xH, Hits: > -2.899, size: 2330637, queued_as: CF19BB87B, 3092 ms > Aug 1 15:41:19 tauro cbpolicyd[72821]: module=Quotas, mode=update, > host=10.25.80.8, helo=mail.domain.com, [email protected], > [email protected], reason=quota_update, policy=5, quota=3, limit=4, > track=Sender:[email protected], counter=MessageCumulativeSize, > quota=990000/1000000 (99.0%) > Aug 1 15:41:32 tauro cbpolicyd[72653]: module=Quotas, mode=update, > host=10.25.80.8, helo=mail.domain.com, [email protected], > [email protected], reason=quota_update, policy=5, quota=3, limit=4, > track=Sender:[email protected], counter=MessageCumulativeSize, > quota=3320456/1000000 (332.0%) > Aug 1 15:41:32 tauro postfix/qmgr[45088]: E23F2B88B: > from=<[email protected]>, size=2330637, nrcpt=1 (queue active) > Aug 1 15:41:32 tauro cbpolicyd[72821]: module=Quotas, mode=create, > host=10.25.80.8, helo=mail.domain.com, [email protected], > [email protected], reason=quota_create, policy=5, quota=3, limit=4, > track=Sender:[email protected], counter=MessageCumulativeSize, > quota=1000000/1000000 (100.0%) > Aug 1 15:41:34 tauro postfix/qmgr[45088]: BDB3EB892: > from=<[email protected]>, size=2331082, nrcpt=1 (queue active) > Aug 1 15:41:34 tauro amavis[74374]: (74374-04) Passed CLEAN, [10.25.80.8] > [10.25.80.8] <[email protected]> -> <[email protected]>, Message-ID: > <[email protected]>, mail_id: lB3QyHzrMiRc, Hits: > -2.899, size: 2330637, queued_as: BDB3EB892, 2773 ms > Aug 1 15:41:43 tauro cbpolicyd[73545]: module=Quotas, mode=update, > host=10.25.80.8, helo=mail.domain.com, [email protected], > [email protected], reason=quota_update, policy=5, quota=3, limit=4, > track=Sender:[email protected], counter=MessageCumulativeSize, > quota=3330456/1000000 (333.0%) > Aug 1 15:41:43 tauro postfix/qmgr[45088]: E8349B8AD: > from=<[email protected]>, size=2330637, nrcpt=1 (queue active) > Aug 1 15:41:46 tauro postfix/qmgr[45088]: D2F5DB869: > from=<[email protected]>, size=2331082, nrcpt=1 (queue active) > Aug 1 15:41:46 tauro amavis[74380]: (74380-02) Passed CLEAN, [10.25.80.8] > [10.25.80.8] <[email protected]> -> <[email protected]>, Message-ID: > <[email protected]>, mail_id: nRY0tfSChj0p, Hits: > -2.899, size: 2330637, queued_as: D2F5DB869, 2680 ms > Aug 1 15:42:11 tauro cbpolicyd[72821]: module=Quotas, mode=update, > host=10.25.80.8, helo=mail.domain.com, [email protected], > [email protected], reason=quota_update, policy=5, quota=3, limit=4, > track=Sender:[email protected], counter=MessageCumulativeSize, > quota=992222/1000000 (99.2%) > Aug 1 15:42:23 tauro cbpolicyd[73545]: module=Quotas, mode=update, > host=10.25.80.8, helo=mail.domain.com, [email protected], > [email protected], reason=quota_update, policy=5, quota=3, limit=4, > track=Sender:[email protected], counter=MessageCumulativeSize, > quota=988915/1000000 (98.9%) > Aug 1 15:42:23 tauro cbpolicyd[74013]: module=Quotas, mode=update, > host=10.25.80.8, helo=mail.domain.com, [email protected], > [email protected], reason=quota_update, policy=5, quota=3, limit=4, > track=Sender:[email protected], counter=MessageCumulativeSize, > quota=3319371/1000000 (331.9%) > > As you can see I've sent a number of messages that weigh more than 1MB but > they always get thru.
Set the period to 86400 , set the limit to 1 000 000 . Send 3 x 2Mb emails. You will see the second and third will get blocked. You never tried to send a second message above once the limit was exceeded. And if your period was set to 20s, it means in 20s the sender can send another 1Mb of email.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Users mailing list [email protected] http://lists.policyd.org/mailman/listinfo/users
