Plesk 17: Calculate mailbox usage per domain

0

I am trying to export the list of emails that their quota is over 80% percent. I am quite new on Plesk scripts and this is where I am right now:

 mysql -uadmin -p`cat /etc/psa/.psa.shadow ` psa -NBe"
select m.mail_name, d.name, m.mbox_quota from mail as m 
left join domains as d on m.dom_id=d.id 
where m.mbox_quota <> -1 ;" | 
while read j i k; 
do echo $j"@"$i; 
/usr/local/psa/admin/bin/mailmng-core --get-mailbox-size --domain-name=$i --mailname=$j; 
echo ""/$k;
done

Which will output something like this: (all emails with no unlimited quota)

email@domain.com

{actual_usage}/{quota}

....

How I can do the calculation in order to export only the email accounts that are over 80% and their usage percentage?

thelaw

Posted 2020-02-19T09:52:13.013

Reputation: 1

No answers