mail_storage_set_error(storage, MAIL_ERROR_NOQUOTA, errstr);
break;
case QUOTA_ALLOC_RESULT_TEMPFAIL:
+ case QUOTA_ALLOC_RESULT_BACKGROUND_CALC:
mail_storage_set_critical(storage, "quota: %s", internal_err);
break;
case QUOTA_ALLOC_RESULT_OK:
/* Log the error, but allow saving anyway. */
i_error("quota: Failed to check if user is under quota: %s - saving mail anyway", error);
return 0;
+ case QUOTA_ALLOC_RESULT_BACKGROUND_CALC:
+ /* Could not determine if there is enough space due to ongoing
+ background quota calculation, allow saving anyway. */
+ return 0;
default:
quota_set_storage_error(qt, t->box->storage, ret, error);
return -1;
/* Log the error, but allow saving anyway. */
i_error("quota: Failed to check if user is under quota: %s - saving mail anyway", error);
break;
+ case QUOTA_ALLOC_RESULT_BACKGROUND_CALC:
+ /* Could not determine if there is enough space due to
+ * ongoing background quota calculation, allow saving
+ * anyway. */
+ break;
default:
quota_set_storage_error(qt, t->box->storage, qret, error);
return -1;
switch (res) {
case QUOTA_ALLOC_RESULT_OK:
return "OK";
+ case QUOTA_ALLOC_RESULT_BACKGROUND_CALC:
+ return "Blocked by an ongoing background quota calculation";
case QUOTA_ALLOC_RESULT_TEMPFAIL:
return "Internal quota calculation error";
case QUOTA_ALLOC_RESULT_OVER_MAXSIZE:
QUOTA_ALLOC_RESULT_OVER_QUOTA,
/* Mail size is larger than even the maximum allowed quota. */
QUOTA_ALLOC_RESULT_OVER_QUOTA_LIMIT,
+ /* Blocked by ongoing background quota calculation. */
+ QUOTA_ALLOC_RESULT_BACKGROUND_CALC,
};
/* Anything <= QUOTA_GET_RESULT_INTERNAL_ERROR is an error. */