diff --git a/interface/web/mail/mail_user_edit.php b/interface/web/mail/mail_user_edit.php
index 6ff11f87a124eb86edfdd2009c1fc61191eeefbd..d9de033d95068f51653d884cf8f9da63d6848f42 100644
--- a/interface/web/mail/mail_user_edit.php
+++ b/interface/web/mail/mail_user_edit.php
@@ -146,7 +146,7 @@ class page_action extends tform_actions {
 				$tmp = $app->db->queryOneRecord("SELECT sum(quota) as mailquota FROM mail_user WHERE mailuser_id != ".intval($this->id)." AND sys_groupid = $client_group_id");
 				$mailquota = $tmp["mailquota"] / 1024 / 1024;
 				$new_mailbox_quota = intval($this->dataRecord["quota"]);
-				if($mailquota + $new_mailbox_quota > $client["limit_mailquota"]) {
+				if(($mailquota + $new_mailbox_quota > $client["limit_mailquota"]) || ($new_mailbox_quota == 0 && $client["limit_mailquota"] != -1)) {
 					$max_free_quota = $client["limit_mailquota"] - $mailquota;
 					$app->tform->errorMessage .= $app->tform->lng("limit_mailquota_txt").": ".$max_free_quota."<br>";
 					// Set the quota field to the max free space