• Inviting everyone who uses WordPress management tools in Plesk
    The Plesk team is conducting a 60-minute research session that includes an interview and a moderated usability test.
    To participate, please use this link .
    Your experience will help shape product decisions and ensure the tools better support real-world use cases.

Get mailbox size via API

P

pstephan1187

Guest
I am building a mail management program on my server and am using the API RPC on Plesk 10.1.1. I am trying to use this to gather the mailbox usage and quota to give the user a graphical display of how much space they have left. Using the API to get the quota (amongst other things) of a mailbox I send the following XML:

<mail><get_info><filter><site-id>1</site-id><name>test</name></filter><mailbox/><mailbox-usage/><forwarding/><aliases/><autoresponder/></get_info></mail>

If I manually set the quota for that mailbox in plesk I will get the quota in bytes which is expected. However, if I change the mailbox quota to "Set the mailbox size as defined by the service provider (100 MB)" I would receive a response of "-1". Under normal circumstances I understand "-1" to mean infinite. Here are my two questions:

1. If the -1 does indeed mean infinite, how come the mailbox is not set to 100MB?
2. If the -1 rather means default size of 100MB, how do I acquire the default service plan mailbox size with the API RPC? I check the documentation and could not find any information on retrieving that info.
 
For what it's worth, -1 seems to mean that the user is using the domain quota and doesn't have a user quota set. Trying to figure out something like this for myself, so please let me know if you ever received an answer to this.
 
We ran into this issue as well.

Plesk *should* be returning the effective value with that API request, but as @MarkM indicated instead it's a simple database query.

To make this work you'll need to get the subscription's info via <webspace> API request with the <limits/> option so as to obtain the limits. One of those is mbox_quota, which will give you the parent/subscription level quota that you need.
 
Back
Top