Child pages
  • UAPI Functions - Email::list_mail_domains

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt
This function lists the account's mail domains.

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledReceiveMailRole
PageWithExcerptLIB:_ServerRoleDisabledAPI

Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone


Expand
titlecPanel or Webmail Session URL


Code Block
languagetext
https://hostname.example.com:2083/cpsess##########/execute/Email/list_mail_domains?select=example.com

Include Page
LIB:_CallUAPIFromBrowserLink
LIB:_CallUAPIFromBrowserLink


Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List the account's mail domains.
$get_mail_domains = $cpanel->uapi(
    'Email', 'list_mail_domains',
    array(
        'select'        => 'example.com',
         )
);

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink

 


Expand
titleLiveAPI Perl Module


Code Block
languageperl
linenumberstrue
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List the account's mail domains.
my $get_mail_domains = $cpliveapi->uapi(
    'Email', 'list_mail_domains',
    {
        'select'        => 'example.com',
    }
);

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

 


Expand
titlecPanel Template Toolkit


Code Block
languagexml
<!-- List the account's mail domains. -->
[% execute('Email', 'list_mail_domains', { 'select' => 'example.com' } ) %]

Include Page
LIB:_TTLink
LIB:_TTLink

 


Expand
titleCommand Line


Code Block
languagebash
uapi --user=username Email list_mail_domains select=example.com

Include Page
LIB:_UAPICLINote
LIB:_UAPICLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{  
   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{  
      "transformed":1
   },
   "data":[  
      {  
         "domain":"example.com",
         "select":1
      },
      {  
         "domain":"addondomain.com"
      },
      {  
         "domain":"subdomain.example.com"
      },
      {  
         "domain":"seconddomain.com"
      },
      {  
         "domain":"seconddomain.example.com"
      }
   ]
}


Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote


Parameters

ParameterTypeDescriptionPossible valuesExample
selectstring

The name of the domain that the function returns with the select output parameter.

If you do not use this parameter, the function will not return the select parameter with any domains.

A valid domain on the account.

example.com
add_wwwBoolean

Whether to list www. addresses.

This parameter defaults to 0.

  • 1 — List www. addresses.
  • 0 — Do not list www. addresses.

For example, if you specify 1, the function's output would include both   example.com   and www.example.com . If you specify 0, the output would include only example.com .

1
include_wildcardBoolean

Whether to list wildcard addresses.

This parameter defaults to 0.

  • 1 — List wildcard addresses.
  • 0 — Do not list wildcard addresses.

For example, if you specify 1, the function's output would include both   example.com   and *.example.com . If you specify 0, the output would include only example.com .

1

Returns

Note
titleNote:

This function always returns the account's main domain first. 


ReturnTypeDescriptionPossible valuesExample
domainstringThe domain name.

The name of a main domain, addon domain, or subdomain on the cPanel account.

example.com

selectBoolean

The domain that you specified in the select input parameter.

The function only returns this value if you included the select parameter when you called the function.

1 is the only possible value.

Note
titleNote:

Because this value only appears if you included the select input parameter, The value always defaults to 1


1