cPanel API 2 Functions - Email::listpopswithdisk

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 


 WHM API (JSON)

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=

 LiveAPI PHP Class

$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',
    
);

 LiveAPI Perl Module

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',
    }
);

 cPanel Tag System (deprecated)

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.

 

 Command Line

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.

 Output (JSON)

{
  "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.

  • 1 — Limit results.
  • 0 — Do not limit results.

 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.

  • 1 — Only check the.cpanel/email_accounts.yamlfile. 
  • 0 — Check all of the files.

 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.

  • A positive integer that represents the disk quota in Megabytes (MB).
  • unlimited — The email account's disk quota is unlimited.

 555

 diskquota

 integer

 or

 string

 The disk quota.

 This return's value is localized for the account's locale setting.

  • A positive integer that represents the disk quota in Megabytes (MB).
  • unlimited — The email account's disk quota is unlimited.

 555

 diskusedpercent

 integer

 The percentage of disk space that the email account uses.

  • A positive integer.
  • 0 — The account's disk quota is unlimited.

 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).

  • A positive floating-point value.
  • 0 — The account has an unlimited disk quota.

 399.6

 humandiskquota

 string

 The disk quota, in human-readable format.

  • The disk quota and the unit of measure.
  • None — The account's disk quota is unlimited.

 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.

  • A valid email address.
  • The username for the main account.

 user@example.com

 email

 string

 The email address, or the string Main Account.

  • A valid email address.
  •  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.

  • 1 — Incoming email is suspended.
  • 0 — Incoming email is notsuspended.

 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.

  • 1 — Logins are suspended.
  • 0 — Logins are notsuspended.

 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.

  • A positive integer.
  • 0 — The account's disk quota is unlimited.

 72

 _diskquota

 integer

 The disk quota, in bytes.

  • A positive integer.
  • 0 — The account's disk quota is unlimited.

 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 — The function succeeded.
  • 0 — The function failed.

 1

  

 
  • 17 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....