Description

This function checks whether Greylisting is enabled for the cPanel account.

Examples


https://hostname.example.com:2083/cpsess##########/execute/cPGreyList/has_greylisting_enabled

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Check whether the account's Greylisting is enabled.
$has_greylisting_enabled = $cpanel->uapi(
    'cPGreyList', 'has_greylisting_enabled'
);

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Check whether the account's Greylisting is enabled.
my $has_greylisting_enabled = $cpliveapi->uapi(
    'cPGreyList', 'has_greylisting_enabled',
);

<!-- Check whether the account's Greylisting is enabled. -->
[% execute('cPGreyList', 'has_greylisting_enabled',) %]

uapi --user=username cPGreyList has_greylisting_enabled

{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
    
  },
  "data": {
    "enabled": 1
  }
}

Parameters

This function does not accept parameters.

Returns

Return

TypeDescriptionPossible valuesExample

enabled

Boolean

Whether Greylisting is enabled.

  • 1 — Enabled.
  • 0 — Disabled.
0