• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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