UAPI Functions - Email::list_lists

Description

This function lists the account's Mailman mailing lists.

Examples 


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/Email/list_lists?domain=example.com

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// List example.com's mailing lists.
$mailing_lists $cpanel->uapi(
    'Email''list_lists',
    array(
        'domain'     => 'example.com',
         )
);
$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// List example.com's mailing lists.
$mailing_lists $cpanel->uapi(
    'Email''list_lists',
    array(
        'domain'     => 'example.com',
         )
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# List example.com's mailing lists.
my $mailing_lists $cpliveapi->uapi(
    'Email''list_lists',
    {
        'domain'     => 'example.com',
    }
);

 cPanel Template Toolkit

<!-- List example.com's mailing lists. -->
[% execute('Email', 'list_lists', { 'domain' => 'example.com', }) %]

 Command Line

uapi --user=username Email list_lists domain=example.com

 

Notes:

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

 Output (JSON)

{
  "messages": null,
  "errors": null,
  "status": 1,
  "data": [
    {
      "listid": "mylist_example.com",
      "accesstype":"public",
      "desthost": "hostname.example.com",
      "diskused": "17647",
      "humandiskused": "17.23 KB",
      "listadmin":"admin@example.com",
      "list": "mylist@example.com",
      "advertised": "1",
      "archive_private": "0",
      "subscribe_policy": "1"
    }
  ],
  "metadata": {
    "transformed": 1
  }
}

 

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

domain

 string 

The domain to query.

 If you do not use this parameter, the function lists mailing lists for all of the cPanel account's domains. 

 A valid domain on the cPanel account. 

 example.com 

 

Returns

Return

Type

Description

Possible values

Example

listid

string

The mailing list's name and domain.

The mailing list name, an underscore (_), and the domain.

list_example.com

desthost

string

The IP address of the domain that was specified in the domaininput parameter.

An IPv4 address.

172.16.254.1

accesstype

string

The level of access that users have to the mailing list.

  • private— The list has allof the following settings:
    • The list has private archives.
    • The administrator mustapprove subscriptions.
    • The Mailman directory page does not display the list.
  • public — The list has anyof the following settings:
    • The list has public archives.
    • Anyone can subscribe.
    • The Mailman directory page displays the list.

public

list

string

The mailing list name and domain.

The mailing list name, the @character, and the domain.

list@example.com

 subscribe_policy 

integer

 The level of control that the mailing list administrator has over new subscribers. 

  • 1 — Anyone can subscribe. The system sends a confirmation email.
  • 2 — The administrator must approve subscriptions. The system does not send a confirmation email.
  • 3 — The administrator must approve subscriptions. The system sends a confirmation email.

1

archive_private

Boolean

Whether the mailing list archive is private.

  • 1 — The mailing list archive is private.
  • 0 — The mailing list archive is public.

0

advertised

 Boolean 

Whether the Mailman directory page displays the list.

  • 1 — The Mailman directory page displays the list.
  • 0 — The Mailman directory page does not display the list.

1

listadmin

string

The mailing list's administrators' email addresses.

A comma-separated list of email addresses.

 admin@example.com,admin2@example.com 

diskused

integer

The disk space that the mailing list currently uses.

A positive value that represents the disk space used, measured in Megabytes (MB).

20379

humandiskused

string

 The disk space that the mailing list uses, in human-readable format.

The disk space that the mailing list uses, a non-breaking space (\u00a0), and the unit of measure.

19.9\u00a0KB

 

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