Description

This function lists a domain's forwarders.

Examples 




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



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

 



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

 



<!-- 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 %]

 



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



{
  "messages": null,
  "errors": null,
  "status": 1,
  "data": [
    {
      "html_dest": "forwarded@example.com",
      "dest": "forwarded@example.com",
      "html_forward": "user@example.com",
      "forward": "user@example.com",
      "uri_forward": "user%40example.com",
      "uri_dest": "forwarded%40example.com"
    }
  ],
  "metadata": {
    "transformed": 1
  }
}



Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

The domain.

A valid domain on the account.

example.com
regexstring

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

ReturnTypeDescriptionPossible valuesExample

uri_dest

string

The forwarded address.

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

forwarded%40example.com

forward

string

The forwarded mail's destination.

The location to which the system sends forwarded mail.user@example.com

html_dest

string

The forwarded address.

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

forwarded@example.com

uri_forward

string

The forwarded mail's destination.

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

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

user%40example.com

dest

string

The forwarded address.

An email address on the cPanel accountforwarded@example.com

 

html_forward

string

The forwarded mail's destination

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