UAPI Functions - Email::list_pops

Description

This function lists the cPanel account's email accounts.

Examples 


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/Email/list_pops?regex=user

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// List all email addresses that contain "user".
$emails $cpanel->uapi(
    'Email''list_pops',
    array(
        'regex'      => 'user',
        )
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# List all email addresses that contain "user".
my $emails $cpliveapi->uapi(
    'Email''list_pops',
    {
        'regex'      => 'user',
    }
);

 cPanel Template Toolkit

<!-- List all email addresses that contain "user". -->
[% execute('Email', 'list_pops', { 'regex' => 'user', } ) %]

 Command Line

uapi --user=username Email list_pops regex=user

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 Output (JSON)

   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{ 
 
   },
   "data": [
    {
      "email": "user@example.com",
      "login": "user@example.com"
    },
    {
      "email": "username",
      "login": "Main Account"
    }
  ],
}

 Note:

Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.

 

Parameters

Parameter

Type

Description

Possible values

Example

regex

string

A Perl Compatible Regular Expression (PCRE) that filters the results.

A valid PCRE.

user

 no_validate 

 Boolean 

Whether to skip the email database's validation check.

This parameter defaults to 0.

  • 1 — Skip the validation check. 
  • 0 — Run the validation check.

1

skip_main

Boolean

 Whether to exclude the cPanel account's main account from the results. 

This parameter defaults to 0.

  • 1 — Exclude the main account. 
  • 0 — Include the main account. 

0

 

 Returns

 Return 

Type

Description

Possible values

Example

 

 array of hashes 

A hash of data for an email address on the cPanel account.

Each hash includes the email andlogin returns.

 

email

string

An email address.

 The function includes this value in the unnamed hash for each email address. 

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

 user@example.com 

login

string

The email account login.

The function includes this value in the unnamed hash for each email address.

  • A valid email address on the cPanel account.
  • Main Account, for the main account.

user@example.com

 

 

  • 0 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....