Mercurial > dovecot > core-2.2
changeset 14615:0a2126680120
quota: Ignore quota when handling mailbox_move().
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 20 Jun 2012 06:17:40 +0300 |
parents | 544dc10d4b04 |
children | 3a53a2f7927a |
files | src/plugins/quota/quota-storage.c |
diffstat | 1 files changed, 17 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/quota/quota-storage.c Wed Jun 20 06:17:00 2012 +0300 +++ b/src/plugins/quota/quota-storage.c Wed Jun 20 06:17:40 2012 +0300 @@ -170,8 +170,17 @@ if (qbox->module_ctx.super.copy(ctx, mail) < 0) return -1; - /* if copying used saving internally, we already checked the quota */ - return ctx->copying_via_save ? 0 : quota_check(t, ctx->dest_mail); + if (ctx->copying_via_save) { + /* copying used saving internally, we already checked the + quota */ + return 0; + } + if (ctx->moving) { + /* the mail is being moved. the quota won't increase, so allow + this even if user is currently over quota */ + return 0; + } + return quota_check(t, ctx->dest_mail); } static int @@ -183,7 +192,7 @@ uoff_t size; int ret; - if (i_stream_get_size(input, TRUE, &size) > 0) { + if (i_stream_get_size(input, TRUE, &size) > 0 && !ctx->moving) { /* Input size is known, check for quota immediately. This check isn't perfect, especially because input stream's linefeeds may contain CR+LFs while physical message would @@ -227,6 +236,11 @@ if (qbox->module_ctx.super.save_finish(ctx) < 0) return -1; + if (ctx->moving) { + /* the mail is being moved. the quota won't increase, so allow + this even if user is currently over quota */ + return 0; + } return quota_check(ctx->transaction, ctx->dest_mail); }