frostfiretulsa

Registered
May 6, 2020
2
0
1
Thailand
cPanel Access Level
Root Administrator
Hi guys,

New here, and fairly new to WHM/Cpanel, but have been a sysadmin for windows systems for 20+ years.

I have a new (to me) web hosting business that consists of 2 cpanel servers each with 100+ accounts with most accounts containing multiple domains.

On several instances in the last few weeks I have had users contact me because their email is full and causing bouncing. The fix is trivial, but my users are not the most technically minded people. What I would like to do is be able to run a query of some kind that will tell me what email accounts on the server are nearing or at quota... but I cannot find anything like that in WHM. Is there a way to do this?

Thanks in advance,

Dave
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
There is an interface that does this, you can find it at WHM>>Account Information>Show Accounts over Quota

So the best way to check for quotas using a script on cPanel machines is to use the API:

Code:
uapi --user=USER Quota get_quota_info|grep -E 'limit|used'
you could create a loop to loop through all the cPanel users on the system; some examples of this can be found here:
Loop through all accounts and run api calls?
 

frostfiretulsa

Registered
May 6, 2020
2
0
1
Thailand
cPanel Access Level
Root Administrator
Ill take a look at the script option, but that first WHM function you mentioned is not even close. It only shows full accounts over quota, and only those OVER quota. Not those approaching quota - and only for ACCOUNTS... not for individual email addresses under cpanel accounts (which is what I need).
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
Both of those are going to give you account quotas not email quotas - for that you'd use something like

Code:
doveadm quota get -u $user

Full text on using doveadm commands can be found here: Tools/Doveadm/Quota - Dovecot Wiki