Symptoms
Attempting to determine the disk usage for an email account using "du" is greater than the usage reported within "cPanel » Email Accounts"
Description
Checking an email account's disk usage via the command line using the "du" utility may often report more usage than what is seen in the cPanel interface.
Example:
In the following example, the cPanel interface "cPanel » Email Accounts" would report the user (cptech@domain.tld) as using only ~7G.
However, using "du" would show that there is actually 10G in total in the user's directory.
[root@server ~]$ du --max-depth=1 -ch /home/domain/mail/domain.tld/cptech/|sort -rh
10G total
10G /home/domain/mail/domain.tld/cptech/
1.4M /home/domain/mail/domain.tld/cptech/.Sent
7G /home/domain/mail/domain.tld/cptech/cur
3G /home/domain/mail/domain.tld/cptech/.Trash
8.0K /home/domain/mail/domain.tld/cptech/.Archive
4.0K /home/domain/mail/domain.tld/cptech/.Junk
0 /home/domain/mail/domain.tld/cptech/tmp
0 /home/domain/mail/domain.tld/cptech/new
The reason for this is because any email in the Trash directory is not reported as usage. Instead, this is counted under the section "Other Usage" inside of "cPanel » Email Accounts".
The following is stated as well for the description of files located within the "Other Usage" section:
- The files outside of your home directory
- The metadata that the system uses to store email in the mail directory
- The email in Trash folders
- The files that you do not have permission to access.
Workaround
Use the interface to obtain the correct disk usage, or use the following API.
uapi --user=username Email get_disk_usage user=user domain=domain.tld
Disk usage can also be checked using "doveadm":
doveadm quota get -u example@domain.tld
Comments
0 comments
Article is closed for comments.