UAPI Functions - Email::list_forwarders

Description

This function lists a domain's forwarders.

Examples 


 cPanel or Webmail Session URL

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

 LiveAPI PHP Class

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

 LiveAPI Perl Module

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

 cPanel Template Toolkit

<!-- Get a hash of all the data, then display the forwarded email. -->
[% data = execute( 'Email', 'list_forwarders', { 'domain' => 'example.com' } ); %]
[% FOREACH q = data.forward %]
     <p>
         [% q %]
     </p>
[% END %]
  
<!-- Get only the forwarded address. -->
[% execute('Email', 'list_forwarders', { 'domain' => 'example.com' }).data.forward %]

 Command Line

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

 

Notes:

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

 Output (JSON)

{
  "messages": null,
  "errors": null,
  "status": 1,
  "data": [
    {
      "html_dest": "fwdtome@example.com",
      "dest": "fwdtome@example.com",
      "html_forward": "user@example.com",
      "forward": "user@example.com",
      "uri_forward": "user%40example.com",
      "uri_dest": "fwdtome%40example.com"
    }
  ],
  "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

domain

string

Required

The domain.

 A valid domain on the account. 

 example.com 

regex

string

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

 If you do not use this parameter, the function returns results for all of the account's filters. 

A valid PCRE.

user

 

Returns

 

Return

Type

Description

Possible values

Example

uri_dest

 string 

 The forwarded mail's destination. 

 

The location to which the system sends forwarded mail in a URI-encoded format.

 fwdtome%40example.com 

forward

string

The forwarded address.

 

An email address on the cPanel account.

user@example.com

html_dest

string

The forwarded mail's destination.

 

 The location to which the system sends forwarded mail in an HTML-compatible format. 

fwdtome@example.com

uri_forward

string

The forwarded address.

 

An email address on the cPanel account in a URI-encoded format.

user@example.com

dest

string

The forwarded mail's destination.

 

The location to which the system sends forwarded mail.

fwdtome@example.com 

 html_forward 

string

The forwarded address.

 

An email address on the cPanel account in an HTML-compatible format.

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