From: Timo Sirainen Date: Wed, 4 Oct 2017 07:44:47 +0000 (+0300) Subject: imap-quota: Return NO reply if GETQUOTA fails only partially X-Git-Tag: 2.3.0.rc1~939 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bffaca7da2825c2a77aa46022358e2f8400a0f94;p=thirdparty%2Fdovecot%2Fcore.git imap-quota: Return NO reply if GETQUOTA fails only partially If the first resource lookup succeeded and the second one failed, the GETQUOTA command replied with OK instead of NO. --- diff --git a/src/plugins/imap-quota/imap-quota-plugin.c b/src/plugins/imap-quota/imap-quota-plugin.c index fcab5dc3d6..5bac7a2382 100644 --- a/src/plugins/imap-quota/imap-quota-plugin.c +++ b/src/plugins/imap-quota/imap-quota-plugin.c @@ -61,13 +61,13 @@ quota_reply_write(string_t *str, struct mail_user *user, i++; } } - if (ret <= 0 && str_len(str) == prefix_len) { + if (str_len(str) == prefix_len) { /* this quota root doesn't have any quota actually enabled. */ str_truncate(str, orig_len); - return ret; + } else { + str_append(str, ")\r\n"); } - str_append(str, ")\r\n"); - return 1; + return ret < 0 ? -1 : 0; } static bool cmd_getquotaroot(struct client_command_context *cmd)