• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Mailbox disk usage calculation in psa database

Dave_G

New Pleskian
I have noticed in the psa.mail database there are fields for quota and disk_usage but they never seem to change.

We set our subscriptions up via API using service plans, with the mailbox limit set to 2Gb per mailbox. I have read in other articles that the quota set at -1 means its the default or unlimited, but the disk usage is always "0".

How and when is this calculated and stored in to the database?

Dave.
 
So, I created a ticket with Odin on this subject and after a few days they have come back and said its disabled on linux versions (not sure why yet!)

But they did provide me a one liner to get the disk usage:

Code:
mysql -uadmin -p`cat /etc/psa/.psa.shadow ` psa -NBe"select m.mail_name, d.name from mail as m left join domains as d on m.dom_id=d.id;" | while read j i; do echo $j"@"$i; /usr/local/psa/admin/bin/mailmng-core --get-mailbox-size --domain-name=$i --mailname=$j; echo "";done
This will give a list of all mailboxes. If you want a single domain or single mailbox, then just alter the sql part.

Regards
Dave.
 
Back
Top