Description
This function lists a domain's email addresses with quota and disk usage information.
Warning:
We strongly recommend that you use the following UAPI function instead of this function:
-
Email::list_pops_with_disk
— This function lists the cPanel account's email accounts with disk information.
Examples
https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Email&cpanel_jsonapi_func=listpopswithdisk&domain=
$cpanel
=
new
CPANEL();
// Connect to cPanel - only do this once.
// List all example.com email addresses, and validate the
// information across multiple files.
$list_email_address_info
=
$cpanel
->api2(
'Email'
,
'listpopswithdisk'
,
array
(
'domain'
=>
'example.com'
,
'nearquotaonly'
=>
'0'
,
'no_validate'
=>
'0'
,
)
);
my
$cpliveapi
= Cpanel::LiveAPI->new();
# Connect to cPanel - only do this once.
# List all example.com email addresses, and validate the
# information across multiple files.
my
$list_email_addresses
=
$cpliveapi
->api2(
'Email'
,
'listpopswithdisk'
,
{
'domain'
=>
'example.com'
,
'nearquotaonly'
=>
'0'
,
'no_validate'
=>
'0'
,
}
);
Warning:
In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.
cPanel API 2 calls that use cPanel tags vary widely in code syntax and in their output. For more information, read our Deprecated cPanel Tag Usage documentation. Examples are only present in order to help developers move from the old cPanel tag system to our LiveAPI.
cpapi2 --user=username Email listpopswithdisk domain=example.com nearquotaonly= 0 no_validate= 0 regex=user |
Notes:
- You must URI-encode values.
- username represents your account-level username.
{
"cpanelresult": {
"apiversion": 2,
"func": "listpopswithdisk",
"data": [
{
"txtdiskquota": "unlimited",
"diskquota": "unlimited",
"diskusedpercent": 0,
"mtime": 1412881950,
"diskused": 0,
"humandiskquota": "None",
"_diskused": "483",
"login": "user@example.com",
"email": "user@example.com",
"domain": "example.com",
"user": "user",
"suspended_incoming":0,
"suspended_login":0,
"suspended_incoming":0,
"suspended_login":0,
"humandiskused": "483\u00a0bytes",
"diskusedpercent20": 0,
"_diskquota": 0
},
{
"txtdiskquota": "unlimited",
"diskquota": "unlimited",
"diskusedpercent": 0,
"mtime": 1412881950,
"diskused": 0,
"humandiskquota": "None",
"_diskused": "0",
"login": "account@example.com",
"email": "account@example.com",
"domain": "example.com",
"user": "account",
"suspended_incoming":0,
"suspended_login":0,
"suspended_incoming":0,
"suspended_login":0,
"humandiskused": "None",
"diskusedpercent20": 0,
"_diskquota": 0
},
{
"txtdiskquota": 250,
"diskquota": 250,
"diskusedpercent": 0,
"mtime": 1412881950,
"diskused": 0,
"humandiskquota": "250\u00a0MB",
"_diskused": 0,
"login": "mail@addondomain.com",
"email": "mail@addondomain.com",
"domain": "addondomain.com",
"user": "mail",
"suspended_incoming":0,
"suspended_login":0,
"suspended_incoming":0,
"suspended_login":0,
"humandiskused": "None",
"diskusedpercent20": 0,
"_diskquota": "262144000"
}
],
"event": {
"result": 1
},
"module": "Email"
}
}
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
domain |
string |
The domain to search for email address information. If you do not specify a value, the function lists information for all of the account's domains. |
A valid domain on the account. |
example.com |
nearquotaonly |
Boolean |
Whether to limit results to accounts that use 95% or more of their allotted disk space. If you do not specify a value, the function lists information for all email addresses. |
|
0 |
no_validate |
Boolean |
Whether to only read data from the.cpanel/email_accounts.yamlfile. If you specify 0 or do not specify a value, the function also checks thepasswd file and quota files to ensure that the account information is identical. |
|
0 |
regex |
string |
A Perl Compatible Regular Expression (PCRE) that filters the results. The system matches the PCRE to both the email address's username and domain. |
A valid PCRE. |
user |
Returns
Return |
Type |
Description |
Possible values |
Example |
txtdiskquota |
integer or string |
The disk quota. |
|
555 |
diskquota |
integer or string |
The disk quota. This return's value is localized for the account's locale setting. |
|
555 |
diskusedpercent |
integer |
The percentage of disk space that the email account uses. |
|
72 |
mtime |
integer |
The file modification time, in Unix time. |
A time, in Unix time format. |
1412881950 |
diskused |
integer |
The disk space that the email account uses, in Megabytes (MB). |
|
399.6 |
humandiskquota |
string |
The disk quota, in human-readable format. |
|
555 MB |
_diskused |
integer |
The disk space that the email account uses, in bytes. |
A positive integer. |
399600000 |
login |
string |
The email address, or the main account username. |
|
user@example.com |
|
string |
The email address, or the string Main Account. |
|
user@example.com |
domain |
string |
The email account's domain. |
The email account's domain. For example, example.com if the email address isuser@example.com. |
example.com |
user |
string |
The email account username. |
The email account's username. For example, user if the email address is user@example.com. |
user |
suspended_incoming |
Boolean |
Whether the email account's incoming email is suspended. Note: We introduced this return in cPanel & WHM version 54. |
|
0 |
suspended_login |
Boolean |
Whether the user's ability to log in to, send mail from, and read their email account is suspended. Note: We introduced this return in cPanel & WHM version 54. |
|
0 |
humandiskused |
string |
The disk space that the email account uses, in human-readable format. |
The disk space that the email account uses, a non-breaking space (\u00a0), and the unit of measure. |
399.6\u00a0bytes |
diskusedpercent20 |
integer |
The percentage of disk space that the email account uses. |
|
72 |
_diskquota |
integer |
The disk quota, in bytes. |
|
555000000 |
reason |
string |
A reason for failure. Note: This function only returns a reasonvalue if there is an error. |
A string that describes the error. |
This is an error message. |
result |
Boolean |
Whether the function succeeded. |
|
1 |