]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
quota: Don't log "Internal quota calculation error"
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 22 Feb 2017 11:02:27 +0000 (13:02 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 22 Feb 2017 11:02:27 +0000 (13:02 +0200)
It's not very informative and we can't give a better error message without
changing the APIs. The real error should have been logged already anyway,
so this is just duplication of an error. I think originally this was added
because some backend forgot to log an error.

src/plugins/quota/quota-storage.c

index 47adb62f806b2b85b4496b6e4f1f85ea6476c5a7..392d636035471baed4553e6a64e75ea69ef2ccf4 100644 (file)
@@ -238,9 +238,11 @@ static int quota_check(struct mail_save_context *ctx, struct mailbox *src_box)
                                       qt->quota->set->quota_exceeded_msg);
                return -1;
        } else {
-               mail_storage_set_critical(t->box->storage,
-                                         "Internal quota calculation error");
-               /* allow saving anyway */
+               /* allow saving anyway. don't log an error, because at this
+                  point we can't give very informative error without API
+                  changes. the real error should have been logged already
+                  (except if this was due to quota calculation on background,
+                  then we intentionally don't want to log anything) */
                return 0;
        }
 }
@@ -298,9 +300,8 @@ quota_save_begin(struct mail_save_context *ctx, struct istream *input)
                                qt->quota->set->quota_exceeded_msg);
                        return -1;
                } else if (ret < 0) {
-                       mail_storage_set_critical(t->box->storage,
-                               "Internal quota calculation error");
-                       /* allow saving anyway */
+                       /* allow saving anyway. don't log an error - see
+                          quota_check() for reasons. */
                }
        }