On Thu, Nov 24, 2016 at 9:10 PM, Mark Moseley <moseleymark at gmail.com> wrote:> On Thu, Nov 24, 2016 at 10:52 AM, Timo Sirainen <tss at iki.fi> wrote: > >> On 24 Nov 2016, at 9.33, Mark Moseley <moseleymark at gmail.com> wrote: >> > >> > On Wed, Nov 23, 2016 at 6:05 PM, Timo Sirainen <tss at iki.fi> wrote: >> > >> >> On 23 Nov 2016, at 0.49, Mark Moseley <moseleymark at gmail.com> wrote: >> >>> >> >>> If I move messages between namespaces, it appears to ignore the quotas >> >> I've >> >>> set on them. A *copy* will trigger the quota error. But a *move* just >> >>> happily piles on to the overquota namespace. Is that normal? >> >> >> >> Probably needs a bit more thinking, but I guess the attached patch >> would >> >> help. >> >> >> >> >> > I appreciate the patch! Esp on a Weds night. I applied and rerolled >> > dovecot, but I can still move messages into the over-quota namespace. >> >> How about this updated patch? >> >> > Nope, still lets me move messages into the over-quota namespace. > > Both these are true in quota_check: > > ctx->moving > quota_move_requires_check > > > > >> > Out of curiosity, in the Quota wiki page, it mentions that 'in theory >> there >> > could be e.g. "user quota" and "domain quota" roots'. That's also super >> > interesting to me. Does anyone have any experience with that? I.e. any >> > gotchas? >> >> >> There's no automatic quota recalculation for domain quotas, because it >> would have to somehow sum up all the users' quotas. Also I think that it >> still does do the automatic quota recalculation if it gets into a situation >> where it realizes that quotas are wrong, but it'll then just use the single >> user's quota as the entire domain quota. So maybe it would work if you >> externally sum up all the users' quotas and update it to the domain quota >> in cronjob, e.g. once per hour. I guess it would be also nice if the >> internal quota recalculation could be disabled and maybe execute an >> external script to do it (similar to quota-warnings). >> >>Anything else I can try? I'm not sure how the logic in the quota system works, so I'm not sure what to suggest. What's the gist of the patch (i.e. what's it trying to do that it wasn't before)? If I can get a handle on that, I can start littering things with debug statements to try to track stuff down.
On 1 Dec 2016, at 2.22, Mark Moseley <moseleymark at gmail.com> wrote:> >>> How about this updated patch? >>> >>> >> Nope, still lets me move messages into the over-quota namespace. >> >> Both these are true in quota_check: >> >> ctx->moving >> quota_move_requires_check..> Anything else I can try? I'm not sure how the logic in the quota system > works, so I'm not sure what to suggest. What's the gist of the patch (i.e. > what's it trying to do that it wasn't before)? > > If I can get a handle on that, I can start littering things with debug > statements to try to track stuff down.I just messed up the if-check. This one is now committed and should work: https://github.com/dovecot/core/commit/2ec4ab6f5a1172e86afc72c0f29f470d6fd2bd9a.diff <https://github.com/dovecot/core/commit/2ec4ab6f5a1172e86afc72c0f29f470d6fd2bd9a.diff>
On Thu, Dec 1, 2016 at 4:37 AM, Timo Sirainen <tss at iki.fi> wrote:> On 1 Dec 2016, at 2.22, Mark Moseley <moseleymark at gmail.com> wrote: > > > How about this updated patch? > > > Nope, still lets me move messages into the over-quota namespace. > > Both these are true in quota_check: > > ctx->moving > quota_move_requires_check > > .. > > Anything else I can try? I'm not sure how the logic in the quota system > works, so I'm not sure what to suggest. What's the gist of the patch (i.e. > what's it trying to do that it wasn't before)? > > If I can get a handle on that, I can start littering things with debug > statements to try to track stuff down. > > > I just messed up the if-check. This one is now committed and should work: > https://github.com/dovecot/core/commit/2ec4ab6f5a1172e86afc72c0f29f47 > 0d6fd2bd9a.diff > >that looks good. When I apply it, I get: quota-storage.c: In function ?quota_save_finish?: quota-storage.c:337:15: error: ?struct mail_save_context? has no member named ?copy_src_mail? quota-storage.c:337:51: error: ?struct mail_save_context? has no member named ?copy_src_mail? make[4]: *** [quota-storage.lo] Error 1 But if I then also apply the previous patch you gave, though it fails in a number of sections: # patch -p1 < ~moseley/diff2 (Stripping trailing CRs from patch.) patching file src/lib-storage/mail-storage-private.h (Stripping trailing CRs from patch.) patching file src/lib-storage/mail-storage.c Hunk #1 succeeded at 2238 (offset -20 lines). Hunk #2 succeeded at 2255 (offset -20 lines). (Stripping trailing CRs from patch.) patching file src/plugins/quota/quota-storage.c Hunk #1 FAILED at 185. Hunk #2 FAILED at 242. Hunk #3 FAILED at 297. 3 out of 3 hunks FAILED -- saving rejects to file src/plugins/quota/quota-storage.c.rej BUT, it then compiles. I haven't tested it extensively, but with this latest patch, when I try to move mail to the over-quota Archive mailbox, it correctly fails! Awesome!
Apparently Analagous Threads
- Implementing secondary quota w/ "Archive" namespace
- Implementing secondary quota w/ "Archive" namespace
- Implementing secondary quota w/ "Archive" namespace
- Implementing secondary quota w/ "Archive" namespace
- Implementing secondary quota w/ "Archive" namespace