Plesk CLI tools – email account mailbox size updation
If we need to update mailbox quota for a few accounts, we can easily do this from plesk front end. But if the count is high, we may need to script it via cli. Following is the command to update mailbox quota for a single email account.
plesk bin mail -u email@example.com -mbox_quota 1G
If number of mail accounts are a large number, then we can take the email account list for all the mail account from all the domains from the following command.
plesk bin mail -l
Just filter the list with your domain, here it is “example.com”
plesk bin mail -l | grep example.com
Using a for loop to pass each email account from the above list to the quota update command. Here is the exact command for the same.
for email in $(plesk bin mail -l | grep example.com) ; do plesk bin mail -u $email -mbox_quota 1G ; done
Note : Take a backup for psa before doing this change. So that we can restore the settings, if anything goes wrong.