jeroen at intuxicated.org
2009-Sep-10 12:37 UTC
[Dovecot] Question regarding reverse quota_warning
Hi Everyone, I have a question regarding reverse quota_warnings. I'm building a new setup, and I would like to block sending messages if a person is over his/her quota limit. Although this can be accomplished using a quota_warning script, I can't find how to accomplish the reverse. Has anyone tried to do something like this? By looking at the source code: ---- quote ---- if ((bytes_before < (uint64_t)warnings[i].rule.bytes_limit && bytes_current >= (uint64_t)warnings[i].rule.bytes_limit) || (count_before < (uint64_t)warnings[i].rule.count_limit && count_current >= (uint64_t)warnings[i].rule.count_limit)) { quota_warning_execute(root, warnings[i].command); break; } ----- /quote ----- I think it could be as simple as adding a second if statement and prefixing a string, but that's not a very clean solution. Best regards, Jeroen Koekkoek
On Thu, 2009-09-10 at 14:37 +0200, jeroen at intuxicated.org wrote:> Hi Everyone, > > I have a question regarding reverse quota_warnings. I'm building a new > setup, and I would like to block sending messages if a person is over > his/her quota limit.Well, users typically are never over quota. They're just a few kilobytes under quota.. I guess you could use 99% as the limit when to start blocking messages.> Although this can be accomplished using a > quota_warning script, I can't find how to accomplish the reverse. Has > anyone tried to do something like this? > > By looking at the source code: > > ---- quote ---- > if ((bytes_before < (uint64_t)warnings[i].rule.bytes_limit && > bytes_current >= (uint64_t)warnings[i].rule.bytes_limit) || > (count_before < (uint64_t)warnings[i].rule.count_limit && > count_current >= (uint64_t)warnings[i].rule.count_limit)) { > quota_warning_execute(root, warnings[i].command); > break; > } > ----- /quote ----- > > I think it could be as simple as adding a second if statement and prefixing > a string, but that's not a very clean solution.Yeah, similar second if statement should work. I can't think of any really nice and clean way to do this, so I think I'm not going to add that feature until more people want it. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20090913/fe981ac9/attachment-0002.bin>
Seemingly Similar Threads
- [PATCH] [dovecot 2.2.9] Quota warnings ignored with FS quotas
- [PATCH] [dovecot 2.2.9] Quota warnings ignored with FS quotas
- quota_wrning not working for me (quota_rewrite patch for dovecot 1.0.8)
- Quota warning generated when crossing on both sides
- [PATCH] [dovecot 2.2.9] Quota warnings ignored with FS quotas