If you notice that email account disk usage in cPanel displays in KB (e.g., 78 KB) when the actual usage is several GB, this is caused by a synchronization issue between the Dovecot quota files and the cPanel cache.

The dovecot-quota file inside each mailbox is responsible for storing the account's disk usage. When this file is missing or contains incorrect values, cPanel displays outdated data. Additionally, the cPanel datastore caches these values and does not refresh them automatically.
Before starting, retrieve the cPanel username associated with the domain:
grep DOMAIN /etc/userdomains
The output will display something like: domain1.com.mx: domain1c — where domain1c is the USER and domain1.com.mx is the DOMAIN.
Confirm the actual disk space consumed by each email account on the server:
du -sh /home/USER/mail/DOMAIN/*/
If the values match what cPanel displays, no further action is needed. If there are significant discrepancies (cPanel shows KB when the actual usage is MB or GB), proceed with the following steps.
Retrieve the list of email accounts registered in cPanel for the domain:
uapi --user=USER Email list_pops_with_disk | grep "email:"
This script removes any existing dovecot-quota files, recalculates quotas through Dovecot, and writes the correct values for each account:
for account in $(ls /home/USER/mail/DOMAIN/); do
rm -f /home/USER/mail/DOMAIN/${account}/dovecot-quota
doveadm quota recalc -u "${account}@DOMAIN" 2>/dev/null
QUOTA=$(doveadm quota get -u "${account}@DOMAIN" 2>/dev/null \
| grep "Mailbox" | grep "STORAGE" | awk '{print $3}')
MESSAGES=$(doveadm quota get -u "${account}@DOMAIN" 2>/dev/null \
| grep "Mailbox" | grep "MESSAGE" | awk '{print $3}')
if [ -n "$QUOTA" ]; then
MAILPATH="/home/USER/mail/DOMAIN/${account}"
echo "priv/quota/storage=${QUOTA}" > "${MAILPATH}/dovecot-quota"
echo "priv/quota/messages=${MESSAGES}" >> "${MAILPATH}/dovecot-quota"
chown USER:USER "${MAILPATH}/dovecot-quota"
echo "${account}: storage=${QUOTA} messages=${MESSAGES}"
fi
done
Each account will print its name along with the storage and message count values. Verify that these match the output from Step 1.
Remove the datastore cache files to force a fresh read:
rm -f /home/USER/.cpanel/datastore/*email*
rm -f /home/USER/.cpanel/datastore/*quota*
rm -f /home/USER/.cpanel/datastore/_Cpanel::Quota*
Restart the cPanel service so the web interface picks up the updated data:
/scripts/restartsrv_cpsrvd

This step reads the current quota for each account, temporarily sets it to 500 MB, and then restores it to the original value, forcing cPanel to refresh the displayed data in the web interface:
for account in $(ls /home/USER/mail/DOMAIN/); do
# Read the current quota before modifying
CURRENT_LIMIT=$(doveadm quota get -u "${account}@DOMAIN" 2>/dev/null \
| grep "^Mailbox" | grep "STORAGE" | awk '{print $4}')
if [ "$CURRENT_LIMIT" = "-" ] || [ -z "$CURRENT_LIMIT" ]; then
RESTORE_QUOTA=0
else
RESTORE_QUOTA=$((CURRENT_LIMIT / 1024))
fi
# Toggle to force refresh
uapi --user=USER Email edit_pop_quota \
email=${account} domain=DOMAIN quota=500 2>/dev/null
# Restore original quota
uapi --user=USER Email edit_pop_quota \
email=${account} domain=DOMAIN quota=${RESTORE_QUOTA} 2>/dev/null
echo "${account}: restored to ${RESTORE_QUOTA} MB"
done

quota=100).Reload the cPanel page using Ctrl+F5 (hard refresh).
Verify that the Storage values match the output from Step 1.
If an individual account did not update, run the following for that specific account:
uapi --user=USER Email edit_pop_quota \
email=ACCOUNT domain=DOMAIN quota=500
uapi --user=USER Email edit_pop_quota \
email=ACCOUNT domain=DOMAIN quota=0
The following commands can revert the fix and must not be used after completing this procedure:

find /home/USER/mail/ -name "maildirsize" -delete — May cause the values to be rebuilt incorrectly./scripts/fixquotas — Overwrites the quota files with incorrect values.doveadm quota recalc after Step 3 — This command is already executed within the script; running it again may overwrite the dovecot-quota file.