Juan Rossi wrote:

>I am having trouble with the quotas module for policyd 2.0.10,
>
>I have the following configuration as policies, basically throttle SASL
>authenticated users:
>
>Policy: Name Default Ext SASL auth
>Source Members:        $*,!%internal_ips,!%whitelisted
>
>
>I have the quotas set as:
>
>Policy: Default Ext SASL auth
>Name: Quote SASL USER
>Track: SASLUsername
>Period: 600
>Verdict: DEFER
>
>
>And the limit for the above quota set to:
>
>Type                   Counter Limit
>MessageCount           5
>MessageCumulativeSize  10485760
>
>When a email comes in, MessageCount works fine, but the
>MessageCumulativeSize not as expected.
>
>When I test user, during the protocol status RCPT I get the normal stuff:
>
>Apr 19 23:17:24 juan cbpolicyd[15109]: module=Quotas, mode=update,
>host=60.234.162.14, helo=[192.168.0.37], [email protected],
>[email protected], rea
>son=quota_update, policy=7, quota=3, limit=4,
>track=SASLUsername:[email protected], counter=MessageCount,
>quota=2/5 (38.9%)
>Apr 19 23:17:24 juan cbpolicyd[15109]: module=Quotas, mode=update,
>host=60.234.162.14, helo=[192.168.0.37], [email protected],
>[email protected], rea
>son=quota_update, policy=7, quota=3, limit=5,
>track=SASLUsername:[email protected],
>counter=MessageCumulativeSize, quota=656667/10485760 (6.3%)
>
>
>But when the protocol reaches END-OF-MESSAGE I get:
>
>
>Apr 19 23:20:56 juan cbpolicyd[4995]: module=Quotas, mode=update,
>host=60.234.162.14, helo=[192.168.0.37], [email protected],
>[email protected], reas
>on=quota_update, policy=7, quota=3, limit=5,
>track=SASLUsername:[email protected],
>counter=MessageCumulativeSize, quota=7645098/10485760 (72.9%)
>
>
>If I send another email, just behind this one:
>
>Apr 19 23:23:55 juan cbpolicyd[4992]: module=Quotas, mode=update,
>host=60.234.162.14, helo=[192.168.0.37], [email protected],
>[email protected], reason=quota_update, policy=7, quota=3,
>limit=4, track=SASLUsername:[email protected],
>counter=MessageCount, quota=3/5 (33.5%)
>Apr 19 23:23:55 juan cbpolicyd[4992]: module=Quotas, mode=update,
>host=60.234.162.14, helo=[192.168.0.37], [email protected],
>[email protected], reason=quota_update, policy=7, quota=3,
>limit=5, track=SASLUsername:[email protected],
>counter=MessageCumulativeSize, quota=701667/10485760 (6.7%)
>
>END-MESSAGE
>
>Apr 19 23:26:37 juan cbpolicyd[15109]: module=Quotas, mode=update,
>host=60.234.162.14, helo=[192.168.0.37], [email protected],
>[email protected], reason=quota_update, policy=7, quota=3,
>limit=5, track=SASLUsername:[email protected],
>counter=MessageCumulativeSize, quota=7633962/10485760 (72.8%)
>
>
>It like MessageCumulativeSize gets updated to the latest message size,
>in the two stages, instead of work like MessageCount.
>
>What could be the problem?

Looks fine to me. Each time you send a massage, the quota counters 
get updated - by adding the latest message AND by "tailing off" the 
current counter. There is a 3 minute gap between those two messages, 
so the counters will get reduced by about 30% before adding the 
second message. You can see that best with the message count which 
drops from 38% to 33% by the time the second message goes through. 
For the cumulative size, the numbers don't look quite right, I'd 
expect something more in the area of 5M when the second message 
starts going through.

Try sending the messages closer together and see what happens. Also, 
which version are you using ?

-- 
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.
_______________________________________________
Users mailing list
[email protected]
http://lists.policyd.org/mailman/listinfo/users

Reply via email to